|
iceberg-cpp
|
Pluggable logging sink. More...
#include <logger.h>
Public Member Functions | |
| virtual Status | Initialize (const std::unordered_map< std::string, std::string > &properties) |
| Property-based setup, called by Loggers::Load() before first use. | |
| virtual bool | ShouldLog (LogLevel level) const noexcept=0 |
Cheap check whether a record at level would be emitted. | |
| virtual void | Log (LogMessage &&message) noexcept=0 |
| Emit one (already-formatted) record, taking ownership. Must not throw. | |
| virtual void | SetLevel (LogLevel level) noexcept=0 |
| Set the minimum level this logger emits. | |
| virtual LogLevel | level () const noexcept=0 |
| Return the minimum level this logger emits. | |
| 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. | |
Static Public Member Functions | |
| static std::shared_ptr< Logger > | Noop () |
| Return a shared, immortal no-op logger singleton. | |
Pluggable logging sink.
ShouldLog() is the single authority for runtime filtering – the macros call it on every (compile-time-enabled) statement, so level changes by any path take effect immediately. Implementations must be thread-safe and must not throw. They must also obey:
|
inlinevirtualnoexcept |
Flush any buffered output. Must not throw; best-effort on the fatal path.
Reimplemented in iceberg::CerrLogger.
|
inlinevirtual |
Property-based setup, called by Loggers::Load() before first use.
The base implementation applies the "level" property (parsed via LogLevelFromString); an unrecognized value is an InvalidArgument error. The spdlog backend overrides this to also apply "pattern" and then delegates to this base for "level"; CerrLogger uses the base as-is (fixed layout).
|
pure virtualnoexcept |
Return the minimum level this logger emits.
Implemented in iceberg::CerrLogger, and iceberg::CapturingLogger.
|
pure virtualnoexcept |
Emit one (already-formatted) record, taking ownership. Must not throw.
Implemented in iceberg::CerrLogger, and iceberg::CapturingLogger.
|
pure virtualnoexcept |
Set the minimum level this logger emits.
Implemented in iceberg::CerrLogger, and iceberg::CapturingLogger.
|
pure virtualnoexcept |
Cheap check whether a record at level would be emitted.
Implemented in iceberg::CerrLogger, and iceberg::CapturingLogger.