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

Test sink that records every emitted LogMessage under a mutex. More...

#include <logging_test_helpers.h>

Inheritance diagram for iceberg::CapturingLogger:
iceberg::Logger

Public Member Functions

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.
 
std::vector< LogMessagerecords () const
 
std::size_t count () const
 
- 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 void Flush () noexcept
 Flush any buffered output. Must not throw; best-effort on the fatal path.
 
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

Test sink that records every emitted LogMessage under a mutex.

Member Function Documentation

◆ level()

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

Return the minimum level this logger emits.

Implements iceberg::Logger.

◆ Log()

void iceberg::CapturingLogger::Log ( LogMessage &&  message)
inlineoverridevirtualnoexcept

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

Implements iceberg::Logger.

◆ SetLevel()

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

Set the minimum level this logger emits.

Implements iceberg::Logger.

◆ ShouldLog()

bool iceberg::CapturingLogger::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 file: