|
Logger System 0.1.3
High-performance C++20 thread-safe logging system with asynchronous capabilities
|
Base implementation for log formatters. More...
#include <base_formatter.h>


Public Member Functions | |
| virtual | ~base_formatter ()=default |
| virtual std::string | format (const log_entry &entry) const override=0 |
| Format a log entry into a string. | |
Public Member Functions inherited from kcenon::logger::log_formatter_interface | |
| virtual | ~log_formatter_interface ()=default |
| virtual void | set_options (const format_options &opts) |
| Set formatting options. | |
| virtual format_options | get_options () const |
| Get current formatting options. | |
| virtual std::string | get_name () const =0 |
Protected Member Functions | |
| std::string | level_to_string (log_level level) const |
| Convert log level to string. | |
| std::string | format_timestamp (const std::chrono::system_clock::time_point ×tamp) const |
| Format timestamp to ISO8601 string. | |
| std::string | get_thread_id () const |
| Get current thread ID as string. | |
Additional Inherited Members | |
Protected Attributes inherited from kcenon::logger::log_formatter_interface | |
| format_options | options_ |
Base implementation for log formatters.
Provides common formatting functionality for derived formatters.
Definition at line 31 of file base_formatter.h.
|
virtualdefault |
|
overridepure virtual |
Format a log entry into a string.
| entry | The log entry to format |
Implements kcenon::logger::log_formatter_interface.
Implemented in kcenon::logger::compact_formatter, kcenon::logger::json_formatter, kcenon::logger::json_formatter, and kcenon::logger::plain_formatter.
|
inlineprotected |
Format timestamp to ISO8601 string.
| timestamp | Time point to format |
Definition at line 65 of file base_formatter.h.
Referenced by kcenon::logger::json_formatter::format(), and kcenon::logger::plain_formatter::format().

|
inlineprotected |
Get current thread ID as string.
Definition at line 76 of file base_formatter.h.
Referenced by kcenon::logger::json_formatter::format(), and kcenon::logger::plain_formatter::format().

|
inlineprotected |
Convert log level to string.
| level | Log level |
Definition at line 48 of file base_formatter.h.
Referenced by kcenon::logger::compact_formatter::format(), kcenon::logger::json_formatter::format(), and kcenon::logger::plain_formatter::format().
