Logger System
1.0.0
High-performance C++20 thread-safe logging system with asynchronous capabilities
Loading...
Searching...
No Matches
raw_formatter.h
Go to the documentation of this file.
1
// BSD 3-Clause License
2
// Copyright (c) 2025, kcenon
3
// See the LICENSE file in the project root for full license information.
4
5
#pragma once
6
28
#include "
../interfaces/log_entry.h
"
29
#include "
../interfaces/log_formatter_interface.h
"
30
31
namespace
kcenon::logger
{
32
39
class
raw_formatter
:
public
log_formatter_interface
{
40
public
:
41
raw_formatter
() =
default
;
42
~raw_formatter
()
override
=
default
;
43
44
std::string
format
(
const
log_entry
& entry)
const override
{
45
return
entry.
message
.
to_string
();
46
}
47
48
std::string
get_name
()
const override
{
49
return
"raw_formatter"
;
50
}
51
};
52
53
}
// namespace kcenon::logger
kcenon::logger::log_formatter_interface
Abstract interface for log message formatters.
Definition
log_formatter_interface.h:73
kcenon::logger::raw_formatter
Formatter that returns log_entry.message verbatim.
Definition
raw_formatter.h:39
kcenon::logger::raw_formatter::raw_formatter
raw_formatter()=default
kcenon::logger::raw_formatter::get_name
std::string get_name() const override
Definition
raw_formatter.h:48
kcenon::logger::raw_formatter::~raw_formatter
~raw_formatter() override=default
kcenon::logger::raw_formatter::format
std::string format(const log_entry &entry) const override
Format a log entry to a string.
Definition
raw_formatter.h:44
kcenon::logger::small_string::to_string
std::string to_string() const
Convert to std::string.
Definition
small_string.h:331
log_entry.h
Data structures for representing log entries and source locations kcenon.
log_formatter_interface.h
Interface for log message formatters (Strategy Pattern) kcenon.
kcenon::logger
Definition
common_logger_adapter.h:29
kcenon::logger::log_entry
Represents a single log entry with all associated metadata.
Definition
log_entry.h:155
kcenon::logger::log_entry::message
small_string_256 message
The actual log message.
Definition
log_entry.h:169
include
kcenon
logger
formatters
raw_formatter.h
Generated by
1.12.0