|
RADLib
RADical C++ application framework
|
RADLogging is the beta logging layer for deployed RADLib applications. It provides an async, process-wide logger with severity levels, category filters, and pluggable sinks.
The core is the singleton RADLogging::Logger, obtained through Logger::instance(). Call start() to launch the background worker thread and shutdown() to drain and stop it; flush() forces queued messages out. setLevel() / level() control the minimum RADLogging::Level (from Trace through Critical, plus Off), and setCategoryEnabled() toggles individual categories. shouldLog() reports whether a level/category pair would be accepted, and log() queues a message directly.
Output destinations are RADLogging::Sink implementations, added with addSink() and removed with clearSinks(). The factory functions consoleSink(), fileSink(), rotatingFileSink() (with maxBytes and maxFiles), and syslogSink() cover the common cases. levelName() formats a level as text.
Most application code uses the streaming macros RADLOG_TRACE, RADLOG_DEBUG, RADLOG_INFO, RADLOG_WARNING, and RADLOG_ERROR. Each takes a category string and returns a RADLogging::LogStream that accumulates via operator<< and emits the completed line when it is destroyed.
Core features:
RADLOG_INFO("category") << "message".Example: