|
Logger System 0.1.3
High-performance C++20 thread-safe logging system with asynchronous capabilities
|
Configuration strategy based on environment variables. More...
#include <environment_strategy.h>


Public Member Functions | |
| std::string | get_name () const override |
| Get the strategy name. | |
| void | apply (logger_config &config) const override |
| Apply this strategy to a logger configuration. | |
| bool | is_applicable () const override |
| Check if this strategy is applicable in the current context. | |
| int | priority () const override |
| Get the strategy priority. | |
Public Member Functions inherited from kcenon::logger::config_strategy_interface | |
| virtual | ~config_strategy_interface ()=default |
Static Private Member Functions | |
| static log_level | parse_log_level (const char *str) |
| static bool | parse_bool (const char *str) |
| static std::size_t | parse_size (const char *str, std::size_t default_value) |
Configuration strategy based on environment variables.
Reads environment variables and applies corresponding settings to the logger configuration. Useful for containerized deployments where configuration is passed via environment.
Definition at line 40 of file environment_strategy.h.
|
inlineoverridevirtual |
Apply this strategy to a logger configuration.
| config | The configuration to modify |
Modifies the provided configuration according to the strategy's rules. Changes are applied in-place.
Implements kcenon::logger::config_strategy_interface.
Definition at line 46 of file environment_strategy.h.
References kcenon::logger::logger_config::async, kcenon::logger::logger_config::batch_size, kcenon::logger::logger_config::buffer_size, kcenon::logger::logger_config::enable_batch_writing, kcenon::logger::logger_config::enable_color_output, kcenon::logger::logger_config::enable_crash_handler, kcenon::logger::logger_config::enable_metrics, kcenon::logger::logger_config::enable_structured_logging, kcenon::logger::logger_config::flush_interval, kcenon::logger::logger_config::max_queue_size, kcenon::logger::logger_config::min_level, parse_bool(), parse_log_level(), and parse_size().

|
inlineoverridevirtual |
Get the strategy name.
Implements kcenon::logger::config_strategy_interface.
Definition at line 42 of file environment_strategy.h.
|
inlineoverridevirtual |
Check if this strategy is applicable in the current context.
Override to implement conditional strategy application (e.g., only apply in certain environments).
Reimplemented from kcenon::logger::config_strategy_interface.
Definition at line 108 of file environment_strategy.h.
|
inlinestaticprivate |
Definition at line 139 of file environment_strategy.h.
Referenced by apply().

|
inlinestaticprivate |
Definition at line 125 of file environment_strategy.h.
Referenced by apply().

|
inlinestaticprivate |
Definition at line 145 of file environment_strategy.h.
Referenced by apply().

|
inlineoverridevirtual |
Get the strategy priority.
When multiple strategies are applied, they are sorted by priority (descending) before application.
Reimplemented from kcenon::logger::config_strategy_interface.
Definition at line 119 of file environment_strategy.h.