|
Logger System 0.1.3
High-performance C++20 thread-safe logging system with asynchronous capabilities
|
Comprehensive decorator pattern usage examples. More...
#include <kcenon/logger/builders/writer_builder.h>#include <kcenon/logger/core/logger.h>#include <kcenon/logger/interfaces/log_filter_interface.h>#include <kcenon/logger/writers/async_writer.h>#include <kcenon/logger/writers/console_writer.h>#include <kcenon/logger/writers/file_writer.h>#include <iostream>#include <memory>#include <thread>#include <chrono>
Go to the source code of this file.
Classes | |
| class | level_filter |
| Custom filter that only allows specific log levels. More... | |
| class | content_filter |
| Custom filter that filters by message content. More... | |
Functions | |
| void | print_section (const std::string &title) |
| void | example_core_writers () |
| Example 1: Core Writers (No Decorators) | |
| void | example_single_decorators () |
| Example 2: Single Decorator Usage. | |
| void | example_multiple_decorators () |
| Example 3: Multiple Decorator Composition. | |
| void | example_performance_patterns () |
| Example 4: Performance Comparison. | |
| void | example_production_scenarios () |
| Example 5: Real-World Production Scenarios. | |
| void | example_custom_filtering () |
| Example 6: Custom Filtering Patterns. | |
| void | example_migration_patterns () |
| Example 7: Migration from Manual Nesting. | |
| int | main () |
| void example_core_writers | ( | ) |
Example 1: Core Writers (No Decorators)
Demonstrates the base writers without any decorators. These are the foundation that decorators wrap.
Definition at line 95 of file decorator_usage.cpp.
References kcenon::logger::console_writer::get_name(), kcenon::logger::file_writer::get_name(), and print_section().
Referenced by main().


| void example_custom_filtering | ( | ) |
Example 6: Custom Filtering Patterns.
Shows advanced filtering scenarios.
Definition at line 414 of file decorator_usage.cpp.
References print_section().
Referenced by main().


| void example_migration_patterns | ( | ) |
Example 7: Migration from Manual Nesting.
Shows how to migrate from deprecated manual decorator nesting.
Definition at line 455 of file decorator_usage.cpp.
References print_section().
Referenced by main().


| void example_multiple_decorators | ( | ) |
Example 3: Multiple Decorator Composition.
Demonstrates combining multiple decorators. ORDER MATTERS: Core → Filter → Buffer → Encrypt → Thread-Safe → Async
Definition at line 194 of file decorator_usage.cpp.
References print_section().
Referenced by main().


| void example_performance_patterns | ( | ) |
Example 4: Performance Comparison.
Demonstrates performance characteristics of different decorator combinations.
Definition at line 278 of file decorator_usage.cpp.
References print_section().
Referenced by main().


| void example_production_scenarios | ( | ) |
Example 5: Real-World Production Scenarios.
Practical examples from production use cases.
Definition at line 317 of file decorator_usage.cpp.
References kcenon::logger::logger::add_writer(), kcenon::logger::logger::flush(), kcenon::logger::logger::log(), and print_section().
Referenced by main().


| void example_single_decorators | ( | ) |
Example 2: Single Decorator Usage.
Shows how each decorator works independently.
Definition at line 123 of file decorator_usage.cpp.
References kcenon::logger::decorator_writer_base::get_name(), kcenon::logger::filtered_writer::get_name(), and print_section().
Referenced by main().


| int main | ( | ) |
Definition at line 501 of file decorator_usage.cpp.
References example_core_writers(), example_custom_filtering(), example_migration_patterns(), example_multiple_decorators(), example_performance_patterns(), example_production_scenarios(), example_single_decorators(), and print_section().

| void print_section | ( | const std::string & | title | ) |
Definition at line 83 of file decorator_usage.cpp.
Referenced by example_core_writers(), example_custom_filtering(), example_migration_patterns(), example_multiple_decorators(), example_performance_patterns(), example_production_scenarios(), example_single_decorators(), and main().
