17#ifndef TOOLBOX_SYS_LOG_HPP
18#define TOOLBOX_SYS_LOG_HPP
36 template <
typename ValueT>
39 log.os_ << std::forward<ValueT>(
val);
54 const auto size{os_.size()};
68 constexpr explicit operator bool()
const {
return true; }
82 const std::ios::fmtflags flags_;
89#define TOOLBOX_LOG(LEVEL) \
90toolbox::is_log_level(LEVEL) && toolbox::Log{toolbox::WallClock::now(), LEVEL}()
92#define TOOLBOX_CRIT TOOLBOX_LOG(toolbox::LogLevel::Crit)
93#define TOOLBOX_ERROR TOOLBOX_LOG(toolbox::LogLevel::Error)
94#define TOOLBOX_WARN TOOLBOX_LOG(toolbox::LogLevel::Warn)
95#define TOOLBOX_METRIC TOOLBOX_LOG(toolbox::LogLevel::Metric)
96#define TOOLBOX_NOTICE TOOLBOX_LOG(toolbox::LogLevel::Notice)
97#define TOOLBOX_INFO TOOLBOX_LOG(toolbox::LogLevel::Info)
99#if TOOLBOX_BUILD_DEBUG
100#define TOOLBOX_DEBUG TOOLBOX_LOG(toolbox::LogLevel::Debug)
102#define TOOLBOX_DEBUG false && toolbox::Log{WallClock::now(), toolbox::LogLevel::Debug}()