|
Common System 0.2.0
Common interfaces and patterns for system integration
|
Standard log entry structure. More...
#include <logger_interface.h>

Public Member Functions | |
| log_entry (log_level lvl=log_level::info, const std::string &msg="") | |
| Default constructor. | |
| log_entry (log_level lvl=log_level::info, const std::string &msg="") | |
Static Public Member Functions | |
| static log_entry | create (log_level lvl, std::string_view msg, const source_location &loc=source_location::current()) |
| Factory method to create a log_entry with source_location. | |
| static log_entry | create (log_level lvl, std::string_view msg, const source_location &loc=source_location::current()) |
Public Attributes | |
| log_level | level |
| std::string | message |
| std::string | file |
| int | line |
| std::string | function |
| std::chrono::system_clock::time_point | timestamp |
| source_location | location |
| C++20 source_location (Issue #177) | |
Standard log entry structure.
Definition at line 65 of file logger.cppm.
|
inline |
Default constructor.
| lvl | Log level (default: info) |
| msg | Log message (default: empty) |
Definition at line 99 of file logger_interface.h.
|
inlineexport |
|
inlinestatic |
Factory method to create a log_entry with source_location.
This is the preferred way to create log entries as it automatically captures the source location at the call site and populates the file, line, and function fields for backward compatibility.
| lvl | Log level |
| msg | Log message (string_view for efficiency) |
| loc | Source location (automatically captured at call site) |
Definition at line 124 of file logger_interface.h.
|
inlinestaticexport |
Definition at line 77 of file logger.cppm.
References file, function, level, line, location, message, and timestamp.
|
export |
Definition at line 88 of file logger_interface.h.
Referenced by create(), and kcenon::common::logging::ConsoleLogger::log().
|
export |
Definition at line 90 of file logger_interface.h.
Referenced by create().
|
export |
Definition at line 86 of file logger_interface.h.
Referenced by create(), and kcenon::common::logging::ConsoleLogger::log().
|
export |
Definition at line 89 of file logger_interface.h.
Referenced by create(), and kcenon::common::logging::ConsoleLogger::log().
|
export |
C++20 source_location (Issue #177)
Definition at line 92 of file logger_interface.h.
Referenced by create().
|
export |
Definition at line 87 of file logger_interface.h.
Referenced by create(), and kcenon::common::logging::ConsoleLogger::log().
|
export |
Definition at line 91 of file logger_interface.h.
Referenced by create().