iceberg-cpp
Loading...
Searching...
No Matches
Public Member Functions | List of all members
iceberg::CerrLogger Class Reference

Logger that writes one line per record to std::cerr. More...

#include <cerr_logger.h>

Inheritance diagram for iceberg::CerrLogger:
iceberg::Logger

Public Member Functions

 CerrLogger (LogLevel level=LogLevel::kInfo)
 
bool ShouldLog (LogLevel level) const noexcept override
 Cheap check whether a record at level would be emitted.
 
void Log (LogMessage &&message) noexcept override
 Emit one (already-formatted) record, taking ownership. Must not throw.
 
void SetLevel (LogLevel level) noexcept override
 Set the minimum level this logger emits.
 
LogLevel level () const noexcept override
 Return the minimum level this logger emits.
 
void Flush () noexcept override
 Flush any buffered output. Must not throw; best-effort on the fatal path.
 
- Public Member Functions inherited from iceberg::Logger
virtual Status Initialize (const std::unordered_map< std::string, std::string > &properties)
 Property-based setup, called by Loggers::Load() before first use.
 
virtual bool IsNoop () const
 Return true if this logger is a no-op.
 

Additional Inherited Members

- Static Public Member Functions inherited from iceberg::Logger
static std::shared_ptr< LoggerNoop ()
 Return a shared, immortal no-op logger singleton.
 

Detailed Description

Logger that writes one line per record to std::cerr.

Line layout: YYYY-MM-DDThh:mm:ss.mmmZ LEVEL [tid] [file:line] message. The minimum level is held in a lock-free atomic; a mutex serializes the whole-line write so concurrent records never interleave. Pure standard library – always compiled, regardless of ICEBERG_SPDLOG.

Member Function Documentation

◆ Flush()

void iceberg::CerrLogger::Flush ( )
overridevirtualnoexcept

Flush any buffered output. Must not throw; best-effort on the fatal path.

Reimplemented from iceberg::Logger.

◆ level()

LogLevel iceberg::CerrLogger::level ( ) const
inlineoverridevirtualnoexcept

Return the minimum level this logger emits.

Implements iceberg::Logger.

◆ Log()

void iceberg::CerrLogger::Log ( LogMessage &&  message)
overridevirtualnoexcept

Emit one (already-formatted) record, taking ownership. Must not throw.

Implements iceberg::Logger.

◆ SetLevel()

void iceberg::CerrLogger::SetLevel ( LogLevel  level)
inlineoverridevirtualnoexcept

Set the minimum level this logger emits.

Implements iceberg::Logger.

◆ ShouldLog()

bool iceberg::CerrLogger::ShouldLog ( LogLevel  level) const
inlineoverridevirtualnoexcept

Cheap check whether a record at level would be emitted.

Implements iceberg::Logger.


The documentation for this class was generated from the following files: