|
Common System 0.2.0
Common interfaces and patterns for system integration
|
Standard interface for logging implementations. More...
#include <logger_interface.h>


Public Member Functions | |
| virtual | ~ILogger ()=default |
| virtual VoidResult | log (log_level level, const std::string &message)=0 |
| Log a message with specified level. | |
| virtual VoidResult | log (log_level level, std::string_view message, const source_location &loc=source_location::current()) |
| Log a message with source location information (C++20) | |
| virtual VoidResult | log (const log_entry &entry)=0 |
| Log a structured entry. | |
| virtual bool | is_enabled (log_level level) const =0 |
| Check if logging is enabled for the specified level. | |
| virtual VoidResult | set_level (log_level level)=0 |
| Set the minimum log level. | |
| virtual log_level | get_level () const =0 |
| Get the current minimum log level. | |
| virtual VoidResult | flush ()=0 |
| Flush any buffered log messages. | |
| virtual | ~ILogger ()=default |
| virtual VoidResult | log (log_level level, const std::string &message)=0 |
| virtual VoidResult | log (log_level level, std::string_view message, const source_location &loc=source_location::current()) |
| virtual VoidResult | log (const log_entry &entry)=0 |
| virtual bool | is_enabled (log_level level) const =0 |
| virtual VoidResult | set_level (log_level level)=0 |
| virtual log_level | get_level () const =0 |
| virtual VoidResult | flush ()=0 |
Standard interface for logging implementations.
This interface defines the contract for any logging implementation, allowing modules to work with different logging backends without direct dependencies.
Definition at line 95 of file logger.cppm.
|
virtualdefault |
|
exportvirtualdefault |
|
pure virtual |
Flush any buffered log messages.
Implemented in kcenon::common::interfaces::NullLogger, and kcenon::common::logging::ConsoleLogger.
|
exportpure virtual |
Implemented in kcenon::common::interfaces::NullLogger, and kcenon::common::logging::ConsoleLogger.
|
pure virtual |
Get the current minimum log level.
Implemented in kcenon::common::interfaces::NullLogger, and kcenon::common::logging::ConsoleLogger.
|
exportpure virtual |
Implemented in kcenon::common::interfaces::NullLogger, and kcenon::common::logging::ConsoleLogger.
|
pure virtual |
Check if logging is enabled for the specified level.
| level | Log level to check |
Implemented in kcenon::common::interfaces::NullLogger, and kcenon::common::logging::ConsoleLogger.
|
exportpure virtual |
Implemented in kcenon::common::interfaces::NullLogger, and kcenon::common::logging::ConsoleLogger.
|
pure virtual |
Log a structured entry.
| entry | Log entry containing all information |
Implemented in kcenon::common::interfaces::NullLogger, and kcenon::common::logging::ConsoleLogger.
|
exportpure virtual |
Implemented in kcenon::common::interfaces::NullLogger, and kcenon::common::logging::ConsoleLogger.
|
pure virtual |
Log a message with specified level.
| level | Log level |
| message | Log message |
Implemented in kcenon::common::interfaces::NullLogger, and kcenon::common::logging::ConsoleLogger.
Referenced by log().

|
exportpure virtual |
Implemented in kcenon::common::interfaces::NullLogger, and kcenon::common::logging::ConsoleLogger.
|
inlinevirtual |
Log a message with source location information (C++20)
This is the preferred method for logging with source location. The default implementation delegates to the simple log(level, message) method for implementations that don't need source location.
| level | Log level |
| message | Log message (string_view for efficiency) |
| loc | Source location (automatically captured at call site) |
Implemented in kcenon::common::interfaces::NullLogger.
Definition at line 186 of file logger_interface.h.
References log().

|
inlineexportvirtual |
Implemented in kcenon::common::interfaces::NullLogger.
Definition at line 101 of file logger.cppm.
References log().

|
pure virtual |
Set the minimum log level.
| level | Minimum level for messages to be logged |
Implemented in kcenon::common::interfaces::NullLogger, and kcenon::common::logging::ConsoleLogger.
|
exportpure virtual |
Implemented in kcenon::common::interfaces::NullLogger, and kcenon::common::logging::ConsoleLogger.