LogIt++
Header-only, macro-first C++ logging library
Loading...
Searching...
No Matches
ILogFormatter.hpp
Go to the documentation of this file.
1
#pragma once
2
#ifndef LOGIT_CPP_HEADER_LOGIT_CPP_LOGIT_FORMATTER_ILOGFORMATTER_HPP_INCLUDED
3
#define LOGIT_CPP_HEADER_LOGIT_CPP_LOGIT_FORMATTER_ILOGFORMATTER_HPP_INCLUDED
4
7
8
#include <string>
9
#include <cstdint>
10
11
namespace
logit
{
12
18
class
ILogFormatter
{
19
public
:
20
virtual
~ILogFormatter
() =
default
;
21
28
virtual
void
set_timestamp_offset
(int64_t offset_ms) = 0;
29
37
virtual
std::string
format
(
const
LogRecord
& record)
const
= 0;
38
44
virtual
bool
is_passthrough
() const noexcept {
return
false
; }
45
};
// ILogFormatter
46
47
};
// namespace logit
48
49
#endif
// LOGIT_CPP_HEADER_LOGIT_CPP_LOGIT_FORMATTER_ILOGFORMATTER_HPP_INCLUDED
logit::ILogFormatter
Interface for formatting log records.
Definition
ILogFormatter.hpp:18
logit::ILogFormatter::~ILogFormatter
virtual ~ILogFormatter()=default
logit::ILogFormatter::is_passthrough
virtual bool is_passthrough() const noexcept
Indicates whether the formatter returns the message unchanged.
Definition
ILogFormatter.hpp:44
logit::ILogFormatter::format
virtual std::string format(const LogRecord &record) const =0
Formats a log record into a string.
logit::ILogFormatter::set_timestamp_offset
virtual void set_timestamp_offset(int64_t offset_ms)=0
Sets the timestamp offset for log formatting.
logit
The primary namespace for the LogIt++ library.
logit::LogRecord
Stores log metadata and content.
Definition
LogRecord.hpp:17
include
logit_cpp
logit
formatter
ILogFormatter.hpp
Generated by
1.12.0