Logger System 0.1.3
High-performance C++20 thread-safe logging system with asynchronous capabilities
Loading...
Searching...
No Matches
kcenon::logger::analysis::realtime_analyzer_factory Class Reference

Factory for creating configured realtime log analyzers. More...

#include <realtime_log_analyzer.h>

Collaboration diagram for kcenon::logger::analysis::realtime_analyzer_factory:
Collaboration graph

Static Public Member Functions

static std::unique_ptr< realtime_log_analyzercreate_basic ()
 Create a basic realtime analyzer with default settings.
 
static std::unique_ptr< realtime_log_analyzercreate (const realtime_analysis_config &config)
 Create a realtime analyzer with custom configuration.
 
static std::unique_ptr< realtime_log_analyzercreate_production (size_t error_threshold=50, realtime_log_analyzer::anomaly_callback callback=nullptr)
 Create a production-ready analyzer with sensible defaults.
 

Detailed Description

Factory for creating configured realtime log analyzers.

Since
3.2.0

Definition at line 639 of file realtime_log_analyzer.h.

Member Function Documentation

◆ create()

static std::unique_ptr< realtime_log_analyzer > kcenon::logger::analysis::realtime_analyzer_factory::create ( const realtime_analysis_config & config)
inlinestatic

Create a realtime analyzer with custom configuration.

Parameters
configAnalysis configuration

Definition at line 652 of file realtime_log_analyzer.h.

653 {
654 return std::make_unique<realtime_log_analyzer>(config);
655 }

◆ create_basic()

static std::unique_ptr< realtime_log_analyzer > kcenon::logger::analysis::realtime_analyzer_factory::create_basic ( )
inlinestatic

Create a basic realtime analyzer with default settings.

Definition at line 644 of file realtime_log_analyzer.h.

644 {
645 return std::make_unique<realtime_log_analyzer>();
646 }

◆ create_production()

static std::unique_ptr< realtime_log_analyzer > kcenon::logger::analysis::realtime_analyzer_factory::create_production ( size_t error_threshold = 50,
realtime_log_analyzer::anomaly_callback callback = nullptr )
inlinestatic

Create a production-ready analyzer with sensible defaults.

Parameters
error_thresholdErrors per minute threshold (default: 50)
callbackAnomaly callback function
Examples
/home/runner/work/logger_system/logger_system/include/kcenon/logger/core/logger_builder.h.

Definition at line 662 of file realtime_log_analyzer.h.

664 {
665
666 realtime_analysis_config config;
667 config.error_spike_threshold = error_threshold;
668 config.rate_anomaly_high_threshold = 1000;
669 config.rate_anomaly_low_threshold = 10;
670 config.track_new_errors = true;
671 config.enable_rate_anomaly_detection = true;
672
673 auto analyzer = std::make_unique<realtime_log_analyzer>(config);
674 if (callback) {
675 analyzer->set_anomaly_callback(std::move(callback));
676 }
677 return analyzer;
678 }

References kcenon::logger::analysis::realtime_analysis_config::enable_rate_anomaly_detection, kcenon::logger::analysis::realtime_analysis_config::error_spike_threshold, kcenon::logger::analysis::realtime_analysis_config::rate_anomaly_high_threshold, kcenon::logger::analysis::realtime_analysis_config::rate_anomaly_low_threshold, and kcenon::logger::analysis::realtime_analysis_config::track_new_errors.


The documentation for this class was generated from the following file: