31 for (
const auto& t: f.data()) {
46 os << std::this_thread::get_id() <<
" ";
51 std::size_t spacing = 1;
52 if (
channelwidth + 15 > channel.size() + filename.size()) {
53 spacing =
channelwidth + 15 - channel.size() - filename.size();
55 os << channel << std::string(spacing,
' ') << filename <<
":" << std::left << std::setw(4) << info.
line <<
" ";
56 os << std::resetiosflags(std::ios::adjustfield);
57 if (!info.
func.empty()) {
58 os << info.
func <<
"(): ";
67 virtual void suffix(std::ostream& os) {
std::string basename(const std::string &filename)
Return the basename of a given filename.
Contains a custom logging facility.
LogLevel
Indicated which log messages should be forwarded to some sink.
This class checks if some log message shall be forwarded to some sink.
virtual void suffix(std::ostream &os)
Prints the suffix of a log message, i.e.
bool printInformation
Print information like log level, file etc.
virtual void configure(const Filter &f) noexcept
Extracts the maximum width of a channel to optimize the formatting.
virtual void prefix(std::ostream &os, const std::string &channel, LogLevel level, const RecordInfo &info)
Prints the prefix of a log message, i.e.
virtual ~Formatter() noexcept=default
std::size_t channelwidth
Width of the longest channel.
Additional information about a log message.
std::string filename
File name.
std::string func
Function name.
std::size_t line
Line number.