|
unilink
0.4.3
A simple C++ library for unified async communication
|
Centralized logging system with async support. More...
#include <logger.hpp>
Classes | |
| struct | Impl |
Public Types | |
| using | LogCallback = std::function< void(LogLevel level, const std::string &formatted_message)> |
Public Member Functions | |
| Logger () | |
| ~Logger () | |
| Logger (Logger &&) noexcept | |
| Logger & | operator= (Logger &&) noexcept |
| Logger (const Logger &)=delete | |
| Logger & | operator= (const Logger &)=delete |
| void | set_level (LogLevel level) |
| Set minimum log level. More... | |
| LogLevel | get_level () const |
| Get current log level. More... | |
| void | set_console_output (bool enable) |
| Enable/disable console output. More... | |
| void | set_file_output (const std::string &filename) |
| Set file output. More... | |
| void | set_file_output_with_rotation (const std::string &filename, const LogRotationConfig &config=LogRotationConfig{}) |
| Set file output with rotation. More... | |
| void | set_async_logging (bool enable, const AsyncLogConfig &config=AsyncLogConfig{}) |
| Enable/disable async logging. More... | |
| bool | is_async_logging_enabled () const |
| Check if async logging is enabled. More... | |
| AsyncLogStats | get_async_stats () const |
| Get async logging statistics. More... | |
| void | set_callback (LogCallback callback) |
| Set log callback. More... | |
| void | set_outputs (int outputs) |
| Set output destinations. More... | |
| void | set_enabled (bool enabled) |
| Enable/disable logging. More... | |
| bool | is_enabled () const |
| Check if logging is enabled. More... | |
| void | set_format (const std::string &format) |
| Set log format. More... | |
| void | flush () |
| Flush all outputs. More... | |
| void | log (LogLevel level, std::string_view component, std::string_view operation, std::string_view message) |
| void | debug (std::string_view component, std::string_view operation, std::string_view message) |
| void | info (std::string_view component, std::string_view operation, std::string_view message) |
| void | warning (std::string_view component, std::string_view operation, std::string_view message) |
| void | error (std::string_view component, std::string_view operation, std::string_view message) |
| void | critical (std::string_view component, std::string_view operation, std::string_view message) |
Static Public Member Functions | |
| static Logger & | instance () |
| Get singleton instance. More... | |
| static Logger & | default_logger () |
Centralized logging system with async support.
Provides thread-safe, configurable logging with multiple output destinations, async processing, batch operations, and performance optimizations for production use.
Definition at line 136 of file logger.hpp.
| using unilink::diagnostics::Logger::LogCallback = std::function<void(LogLevel level, const std::string& formatted_message)> |
Definition at line 138 of file logger.hpp.
|
default |
|
defaultnoexcept |
|
delete |
| void unilink::diagnostics::Logger::critical | ( | std::string_view | component, |
| std::string_view | operation, | ||
| std::string_view | message | ||
| ) |
| void unilink::diagnostics::Logger::debug | ( | std::string_view | component, |
| std::string_view | operation, | ||
| std::string_view | message | ||
| ) |
|
static |
| void unilink::diagnostics::Logger::error | ( | std::string_view | component, |
| std::string_view | operation, | ||
| std::string_view | message | ||
| ) |
| void unilink::diagnostics::Logger::flush | ( | ) |
| AsyncLogStats unilink::diagnostics::Logger::get_async_stats | ( | ) | const |
| LogLevel unilink::diagnostics::Logger::get_level | ( | ) | const |
| void unilink::diagnostics::Logger::info | ( | std::string_view | component, |
| std::string_view | operation, | ||
| std::string_view | message | ||
| ) |
|
static |
| bool unilink::diagnostics::Logger::is_async_logging_enabled | ( | ) | const |
| bool unilink::diagnostics::Logger::is_enabled | ( | ) | const |
| void unilink::diagnostics::Logger::log | ( | LogLevel | level, |
| std::string_view | component, | ||
| std::string_view | operation, | ||
| std::string_view | message | ||
| ) |
| void unilink::diagnostics::Logger::set_async_logging | ( | bool | enable, |
| const AsyncLogConfig & | config = AsyncLogConfig{} |
||
| ) |
| void unilink::diagnostics::Logger::set_callback | ( | LogCallback | callback | ) |
| void unilink::diagnostics::Logger::set_console_output | ( | bool | enable | ) |
| void unilink::diagnostics::Logger::set_enabled | ( | bool | enabled | ) |
| void unilink::diagnostics::Logger::set_file_output | ( | const std::string & | filename | ) |
| void unilink::diagnostics::Logger::set_file_output_with_rotation | ( | const std::string & | filename, |
| const LogRotationConfig & | config = LogRotationConfig{} |
||
| ) |
| void unilink::diagnostics::Logger::set_format | ( | const std::string & | format | ) |
| void unilink::diagnostics::Logger::set_level | ( | LogLevel | level | ) |
| void unilink::diagnostics::Logger::set_outputs | ( | int | outputs | ) |
| void unilink::diagnostics::Logger::warning | ( | std::string_view | component, |
| std::string_view | operation, | ||
| std::string_view | message | ||
| ) |