|
Logger System 0.1.3
High-performance C++20 thread-safe logging system with asynchronous capabilities
|
Demonstrates structured logging features introduced in Phase 3.0. More...
#include <kcenon/logger/core/logger.h>#include <kcenon/logger/core/structured_log_builder.h>#include <kcenon/logger/core/log_context_scope.h>#include <kcenon/logger/writers/console_writer.h>#include <kcenon/logger/formatters/json_formatter.h>#include <kcenon/logger/formatters/logfmt_formatter.h>#include <kcenon/logger/formatters/template_formatter.h>#include <iostream>#include <thread>#include <chrono>
Go to the source code of this file.
Functions | |
| void | basic_structured_logging () |
| Demonstrates basic structured logging with key-value fields. | |
| void | context_propagation_example () |
| Demonstrates context propagation for distributed tracing. | |
| void | context_scope_example () |
| Demonstrates RAII-based context scopes. | |
| void | scoped_context_single_field () |
| Demonstrates single-field scoped context. | |
| void | json_formatter_example () |
| Demonstrates JSON formatter for structured output. | |
| void | logfmt_formatter_example () |
| Demonstrates Logfmt formatter for key=value output. | |
| void | template_formatter_example () |
| Demonstrates template-based custom formatter. | |
| void | multithreaded_context_example () |
| Demonstrates thread-safe context in multi-threaded environment. | |
| void | logger_context_example () |
| Demonstrates logger-level context fields. | |
| int | main () |
Demonstrates structured logging features introduced in Phase 3.0.
Definition in file structured_logging_example.cpp.
| void basic_structured_logging | ( | ) |
Demonstrates basic structured logging with key-value fields.
Definition at line 35 of file structured_logging_example.cpp.
Referenced by main().

| void context_propagation_example | ( | ) |
Demonstrates context propagation for distributed tracing.
Definition at line 75 of file structured_logging_example.cpp.
Referenced by main().

| void context_scope_example | ( | ) |
Demonstrates RAII-based context scopes.
Definition at line 110 of file structured_logging_example.cpp.
Referenced by main().

| void json_formatter_example | ( | ) |
Demonstrates JSON formatter for structured output.
Definition at line 193 of file structured_logging_example.cpp.
References kcenon::logger::log_entry::fields, and kcenon::logger::json_formatter::format().
Referenced by main().


| void logfmt_formatter_example | ( | ) |
Demonstrates Logfmt formatter for key=value output.
Definition at line 214 of file structured_logging_example.cpp.
References kcenon::logger::log_entry::fields, and kcenon::logger::logfmt_formatter::format().
Referenced by main().


| void logger_context_example | ( | ) |
Demonstrates logger-level context fields.
Definition at line 297 of file structured_logging_example.cpp.
Referenced by main().

| int main | ( | ) |
Definition at line 335 of file structured_logging_example.cpp.
References basic_structured_logging(), context_propagation_example(), context_scope_example(), json_formatter_example(), logfmt_formatter_example(), logger_context_example(), multithreaded_context_example(), scoped_context_single_field(), and template_formatter_example().

| void multithreaded_context_example | ( | ) |
Demonstrates thread-safe context in multi-threaded environment.
Definition at line 261 of file structured_logging_example.cpp.
Referenced by main().

| void scoped_context_single_field | ( | ) |
Demonstrates single-field scoped context.
Definition at line 156 of file structured_logging_example.cpp.
Referenced by main().

| void template_formatter_example | ( | ) |
Demonstrates template-based custom formatter.
Definition at line 236 of file structured_logging_example.cpp.
References kcenon::logger::log_entry::fields, kcenon::logger::template_formatter::format(), and kcenon::logger::template_formatter::set_template().
Referenced by main().

