|
Logger System 0.1.3
High-performance C++20 thread-safe logging system with asynchronous capabilities
|
Log analyzer for processing and analyzing log data. More...
#include <log_analyzer.h>

Public Member Functions | |
| void | add_entry (const analyzed_log_entry &entry) |
| Add a log entry for analysis. | |
| void | add_entries (const std::vector< analyzed_log_entry > &entries) |
| Add multiple log entries. | |
| void | clear () |
| Clear all entries. | |
| const analysis_stats & | get_stats () |
| Get analysis statistics. | |
| std::vector< analyzed_log_entry > | filter_by_level (log_level level) const |
| Filter entries by log level. | |
| std::vector< analyzed_log_entry > | filter_by_time_range (const std::chrono::system_clock::time_point &start, const std::chrono::system_clock::time_point &end) const |
| Filter entries by time range. | |
| std::vector< analyzed_log_entry > | search_messages (const std::string &search_text) const |
| Find entries containing specific text. | |
| double | get_error_rate (const std::chrono::minutes &window=std::chrono::minutes(60)) const |
| Get error rate for a time window. | |
| std::string | generate_summary_report () |
| Generate summary report. | |
| void | add_entry (const analyzed_log_entry &entry) |
| Add a log entry for analysis. | |
| void | add_entries (const std::vector< analyzed_log_entry > &entries) |
| Add multiple log entries. | |
| void | clear () |
| Clear all entries. | |
| const analysis_stats & | get_stats () |
| Get analysis statistics. | |
| std::vector< analyzed_log_entry > | filter_by_level (common::interfaces::log_level level) const |
| Filter entries by log level. | |
| std::vector< analyzed_log_entry > | filter_by_time_range (const std::chrono::system_clock::time_point &start, const std::chrono::system_clock::time_point &end) const |
| Filter entries by time range. | |
| std::vector< analyzed_log_entry > | search_messages (const std::string &search_text) const |
| Find entries containing specific text. | |
| double | get_error_rate (const std::chrono::minutes &window=std::chrono::minutes(60)) const |
| Get error rate for a time window. | |
| std::string | generate_summary_report () |
| Generate summary report. | |
| size_t | size () const |
| Get the total number of entries. | |
| bool | empty () const |
| Check if the analyzer has no entries. | |
Private Member Functions | |
| void | update_stats () |
| std::string | level_to_string (log_level level) const |
| void | update_stats () |
| std::string | level_to_string (common::interfaces::log_level level) const |
Private Attributes | |
| std::vector< analyzed_log_entry > | entries_ |
| analysis_stats | cached_stats_ |
| bool | stats_dirty_ = true |
Log analyzer for processing and analyzing log data.
Provides functionality to:
Definition at line 75 of file analysis.cppm.
|
inline |
Add multiple log entries.
Definition at line 69 of file log_analyzer.h.
References entries_, and stats_dirty_.
|
inlineexport |
Add multiple log entries.
| entries | Vector of entries to add |
Definition at line 95 of file analysis.cppm.
References entries_, and stats_dirty_.
|
inline |
Add a log entry for analysis.
Definition at line 61 of file log_analyzer.h.
References entries_, and stats_dirty_.
|
inlineexport |
Add a log entry for analysis.
| entry | The entry to add |
Definition at line 86 of file analysis.cppm.
References entries_, and stats_dirty_.
|
inline |
Clear all entries.
Definition at line 77 of file log_analyzer.h.
References cached_stats_, entries_, and stats_dirty_.
|
inlineexport |
Clear all entries.
Definition at line 103 of file analysis.cppm.
References cached_stats_, entries_, and stats_dirty_.
|
inlineexport |
Check if the analyzer has no entries.
Definition at line 232 of file analysis.cppm.
References entries_.
|
inlineexport |
Filter entries by log level.
| level | The level to filter for |
Definition at line 126 of file analysis.cppm.
References entries_.
|
inline |
Filter entries by log level.
Definition at line 97 of file log_analyzer.h.
References entries_.
|
inline |
Filter entries by time range.
Definition at line 110 of file log_analyzer.h.
References entries_.
|
inlineexport |
Filter entries by time range.
| start | Start of time range |
| end | End of time range |
Definition at line 142 of file analysis.cppm.
References entries_.
|
inline |
Generate summary report.
Definition at line 163 of file log_analyzer.h.
References get_stats(), and level_to_string().

|
inlineexport |
Generate summary report.
Definition at line 200 of file analysis.cppm.
References get_stats(), and level_to_string().

|
inline |
Get error rate for a time window.
Definition at line 139 of file log_analyzer.h.
References entries_.
|
inlineexport |
Get error rate for a time window.
| window | Time window to analyze (default: 60 minutes) |
Definition at line 175 of file analysis.cppm.
References entries_.
|
inline |
Get analysis statistics.
Definition at line 86 of file log_analyzer.h.
References cached_stats_, stats_dirty_, and update_stats().
Referenced by generate_summary_report().


|
inlineexport |
Get analysis statistics.
Definition at line 113 of file analysis.cppm.
References cached_stats_, stats_dirty_, and update_stats().

|
inlineexportprivate |
Definition at line 262 of file analysis.cppm.
|
inlineprivate |
Definition at line 209 of file log_analyzer.h.
Referenced by generate_summary_report().

|
inline |
Find entries containing specific text.
Definition at line 126 of file log_analyzer.h.
References entries_.
|
inlineexport |
Find entries containing specific text.
| search_text | Text to search for |
Definition at line 160 of file analysis.cppm.
References entries_.
|
inlineexport |
Get the total number of entries.
Definition at line 224 of file analysis.cppm.
References entries_.
|
inlineprivate |
Definition at line 184 of file log_analyzer.h.
References cached_stats_, kcenon::logger::analysis::analysis_stats::earliest_timestamp, entries_, kcenon::logger::analysis::analysis_stats::latest_timestamp, kcenon::logger::analysis::analysis_stats::level_counts, and kcenon::logger::analysis::analysis_stats::total_entries.
Referenced by get_stats().

|
inlineexportprivate |
Definition at line 237 of file analysis.cppm.
References cached_stats_, kcenon::logger::analysis::analysis_stats::earliest_timestamp, entries_, kcenon::logger::analysis::analysis_stats::latest_timestamp, kcenon::logger::analysis::analysis_stats::level_counts, and kcenon::logger::analysis::analysis_stats::total_entries.
|
exportprivate |
Definition at line 54 of file log_analyzer.h.
Referenced by clear(), get_stats(), and update_stats().
|
exportprivate |
Definition at line 53 of file log_analyzer.h.
Referenced by add_entries(), add_entry(), clear(), empty(), filter_by_level(), filter_by_level(), filter_by_time_range(), get_error_rate(), search_messages(), size(), and update_stats().
|
exportprivate |
Definition at line 55 of file log_analyzer.h.
Referenced by add_entries(), add_entry(), clear(), and get_stats().