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
11namespace logit {
12
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
Interface for formatting log records.
virtual ~ILogFormatter()=default
virtual bool is_passthrough() const noexcept
Indicates whether the formatter returns the message unchanged.
virtual std::string format(const LogRecord &record) const =0
Formats a log record into a string.
virtual void set_timestamp_offset(int64_t offset_ms)=0
Sets the timestamp offset for log formatting.
The primary namespace for the LogIt++ library.
Stores log metadata and content.
Definition LogRecord.hpp:17