|
iceberg-cpp
|
Bind a logger for the current thread until this object leaves scope. More...
#include <logger.h>
Public Member Functions | |
| ScopedLogger (std::shared_ptr< Logger > logger) noexcept | |
| ScopedLogger (const ScopedLogger &)=delete | |
| ScopedLogger & | operator= (const ScopedLogger &)=delete |
| ScopedLogger (ScopedLogger &&)=delete | |
| ScopedLogger & | operator= (ScopedLogger &&)=delete |
Bind a logger for the current thread until this object leaves scope.
The default logging path on this thread – CurrentLogger(), Log(level, ...), and the LOG_* macros – routes to logger instead of the global default; explicit Log(logger, ...) is unaffected. Bindings nest and restore on exit, and nullptr masks any enclosing binding back to the global default. Lets an engine route Iceberg's own logs into a per catalog/session/query/task context with no call-site changes.
Stack-only and same-thread (non-copyable, non-movable). For thread pools, capture on the submitting thread and re-bind on the worker: