Public Member Functions | |
LogRegistry (LogRegistry const &)=delete | |
LogRegistry (LogRegistry &&)=delete | |
LogRegistry & | operator= (LogRegistry const &)=delete |
LogRegistry & | operator= (LogRegistry &&)=delete |
LoggerPtr | getOrCreateLogger (const std::string &logger_name) |
Gets or creates a logger named logger_name . More... | |
void | drop (const std::string &name) |
Drops a logger from the registry. More... | |
void | dropAll () |
Removes all the registered loggers from the registry. More... | |
void | flush () |
Flush all sinks manually. | |
void | setPattern (const std::string &pattern) |
Sets the output pattern on all registered loggers. | |
void | setLevel (LogLevel severity) |
Sets the minimum level of messages to be logged on all registered loggers. More... | |
void | setConsoleLevel (LogLevel severity) |
Sets the minimum level of messages to be logged to the console. More... | |
std::string const & | getLogFileBaseName () const |
bool | couldOpenLogFile () const |
Static Public Member Functions | |
static LogRegistry & | instance (std::string const *=nullptr) |
Protected Member Functions | |
LogRegistry (std::string const &logFileBaseName) | |
Definition at line 59 of file LogRegistry.h.
LoggerPtr osvr::util::log::LogRegistry::getOrCreateLogger | ( | const std::string & | logger_name | ) |
Gets or creates a logger named logger_name
.
If the logger named logger_name
already exists, return it, otherwise create a new logger of that name.
logger_name | The name of the logger. |
Definition at line 86 of file LogRegistry.cpp.
void osvr::util::log::LogRegistry::drop | ( | const std::string & | name | ) |
Drops a logger from the registry.
The logger will survive until the last copy of it is destroyed (e.g., goes out of scope). This function is useful if you want to destroy a logger before the program terminates.
Definition at line 117 of file LogRegistry.cpp.
void osvr::util::log::LogRegistry::dropAll | ( | ) |
Removes all the registered loggers from the registry.
Each logger will survive until the last copy of it is destroyed (e.g., goes out of scope).
Definition at line 121 of file LogRegistry.cpp.
void osvr::util::log::LogRegistry::setLevel | ( | LogLevel | severity | ) |
Sets the minimum level of messages to be logged on all registered loggers.
Definition at line 137 of file LogRegistry.cpp.
void osvr::util::log::LogRegistry::setConsoleLevel | ( | LogLevel | severity | ) |
Sets the minimum level of messages to be logged to the console.
Definition at line 145 of file LogRegistry.cpp.