Global registry of named loggers, including the default logger used by the RST_LOG_* macros.
More...
#include <RST/log/LogRegistry.hpp>
|
| static Registry & | instance () |
| |
| static std::shared_ptr< Logger > | get (std::string_view name) |
| | Logger named name, created on first use with the global sinks and level.
|
| |
| static std::shared_ptr< Logger > | defaultLogger () |
| | The logger named default, used by the RST_LOG_* macros.
|
| |
| static Logger & | defaultLoggerRef () |
| | Same as defaultLogger(), without the reference counting.
|
| |
| static void | setGlobalLevel (LogLevel level) |
| | Sets the level of every logger, current and future.
|
| |
| static void | addGlobalSink (std::shared_ptr< ISink > sink) |
| | Adds sink to every logger, current and future.
|
| |
| static void | reset () |
| | Removes every logger and global sink, and resets the global level.
|
| |
| static std::shared_ptr< Logger > | init (std::string_view appName="app", LogLevel level=LogLevel::Info, bool toFile=false) |
| | Quick setup: logs from level to the console, and to <appName>.log if toFile is true.
|
| |
Global registry of named loggers, including the default logger used by the RST_LOG_* macros.
◆ Registry()
| RST::Log::Registry::Registry |
( |
const Registry & |
| ) |
|
|
delete |
◆ operator=()
◆ instance()
| static Registry & RST::Log::Registry::instance |
( |
| ) |
|
|
static |
◆ get()
| static std::shared_ptr< Logger > RST::Log::Registry::get |
( |
std::string_view |
name | ) |
|
|
static |
Logger named name, created on first use with the global sinks and level.
- Examples
- log_basic.cpp.
◆ defaultLogger()
| static std::shared_ptr< Logger > RST::Log::Registry::defaultLogger |
( |
| ) |
|
|
static |
The logger named default, used by the RST_LOG_* macros.
◆ defaultLoggerRef()
| static Logger & RST::Log::Registry::defaultLoggerRef |
( |
| ) |
|
|
static |
◆ setGlobalLevel()
| static void RST::Log::Registry::setGlobalLevel |
( |
LogLevel |
level | ) |
|
|
static |
Sets the level of every logger, current and future.
◆ addGlobalSink()
| static void RST::Log::Registry::addGlobalSink |
( |
std::shared_ptr< ISink > |
sink | ) |
|
|
static |
Adds sink to every logger, current and future.
◆ reset()
| static void RST::Log::Registry::reset |
( |
| ) |
|
|
static |
Removes every logger and global sink, and resets the global level.
◆ init()
| static std::shared_ptr< Logger > RST::Log::Registry::init |
( |
std::string_view |
appName = "app", |
|
|
LogLevel |
level = LogLevel::Info, |
|
|
bool |
toFile = false |
|
) |
| |
|
static |
Quick setup: logs from level to the console, and to <appName>.log if toFile is true.
Only the first call adds the sinks (until reset()); later calls just change the level. Returns the default logger.
- Examples
- log_basic.cpp.
The documentation for this class was generated from the following file: