26G::Log::Log( Severity severity ,
const char * file ,
int line ) noexcept :
27 m_severity(severity) ,
30 m_logstream(LogOutput::start(m_severity,m_file,m_line))
32 static_assert(
noexcept(
LogStream(
nullptr)) ,
"" ) ;
46 static_assert(
noexcept(log_output->
at(s)) ,
"" ) ;
47 return log_output && log_output->
at( s ) ;
52 static_assert(
noexcept(m_logstream <<s) ,
"" ) ;
54 return m_logstream << s ;
60 static_assert(
noexcept(m_logstream <<s) ,
"" ) ;
61 return m_logstream << s ;
68 return m_logstream << f.
str() ;
Controls and implements low-level logging output, as used by G::Log.
bool at(Log::Severity) const noexcept
Returns true if logging should occur for the given severity level.
static void output(LogStream &) noexcept
Emits the current log line (see start()).
static LogOutput * instance() noexcept
Returns a pointer to the controlling LogOutput object.
~Log()
Destructor. Writes the accumulated string to the log output.
Log(Severity, const char *file, int line) noexcept
Constructor.
LogStream & operator<<(const char *s) noexcept
Streams 's' and then returns a stream for streaming more stuff into.
static bool at(Severity) noexcept
Returns true if G::LogOutput::output() would log at the given level.
A non-throwing wrapper for std::ostream, used by G::Log.