OSVR Framework (Internal Development Docs)  0.6-1962-g59773924
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
osvr::util::log::LogRegistry Class Reference

Public Member Functions

 LogRegistry (LogRegistry const &)=delete
 
 LogRegistry (LogRegistry &&)=delete
 
LogRegistryoperator= (LogRegistry const &)=delete
 
LogRegistryoperator= (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 LogRegistryinstance (std::string const *=nullptr)
 

Protected Member Functions

 LogRegistry (std::string const &logFileBaseName)
 

Detailed Description

Definition at line 59 of file LogRegistry.h.

Member Function Documentation

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.

Parameters
logger_nameThe name of the logger.
Todo:
should this level be different than other levels?

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.

Todo:
right now this means the filtering is a harmless no-op

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.

Todo:
Does it make sense that we must adjust overall level as well in this case?

Definition at line 145 of file LogRegistry.cpp.


The documentation for this class was generated from the following files: