15#include <kcenon/common/interfaces/logger_interface.h>
82 std::ostringstream oss;
102 oss <<
"[thread:" << entry.
thread_id->to_string() <<
"] ";
113 std::string file_path = entry.
location->file.to_string();
114 if (!file_path.empty()) {
116 oss << filename <<
":" << entry.
location->line;
120 std::string func = entry.
location->function.to_string();
122 oss <<
" in " << func <<
"()";
138 return "timestamp_formatter";
std::string to_string() const
Convert to std::string.
static std::string level_to_color(log_level level, bool use_colors=true)
Convert log level to ANSI color code.
static std::string level_to_string(log_level level)
Convert log level to human-readable string.
static const char * color_reset()
ANSI color reset sequence.
static std::string extract_filename(const std::string &file_path)
Extract filename from full file path.
static std::string format_timestamp(const std::chrono::system_clock::time_point &tp)
Format timestamp to human-readable format (YYYY-MM-DD HH:MM:SS.mmm)
String utility functions for log formatting and conversion.
Represents a single log entry with all associated metadata.
std::optional< source_location > location
Optional source code location information.
std::optional< small_string_64 > thread_id
Optional thread identifier.
log_level level
Severity level of the log message.
small_string_256 message
The actual log message.
std::chrono::system_clock::time_point timestamp
Timestamp when the log entry was created.
Time utility functions for timestamp formatting.