OSVR-Core
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
osvr::util::log::LogRegistry Class Reference

Public Member Functions

 LogRegistry (LogRegistry const &)=delete
 
 LogRegistry (LogRegistry &&)=delete
 
LogRegistryoperator= (LogRegistry const &)=delete
 
LogRegistryoperator= (LogRegistry &&)=delete
 
OSVR_UTIL_EXPORT LoggerPtr getOrCreateLogger (const std::string &logger_name)
 Gets or creates a logger named logger_name. More...
 
OSVR_UTIL_EXPORT void drop (const std::string &name)
 Drops a logger from the registry. More...
 
OSVR_UTIL_EXPORT void dropAll ()
 Removes all the registered loggers from the registry. More...
 
OSVR_UTIL_EXPORT void flush ()
 Flush all sinks manually.
 
OSVR_UTIL_EXPORT void setPattern (const std::string &pattern)
 Sets the output pattern on all registered loggers.
 
OSVR_UTIL_EXPORT void setLevel (LogLevel severity)
 Sets the minimum level of messages to be logged on all registered loggers. More...
 
OSVR_UTIL_EXPORT 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 OSVR_UTIL_EXPORT LogRegistryinstance (std::string const *=nullptr)
 

Protected Member Functions

OSVR_UTIL_EXPORT LogRegistry (std::string const &logFileBaseName)
 

Member Function Documentation

§ drop()

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.

§ dropAll()

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).

§ getOrCreateLogger()

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?

§ setConsoleLevel()

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?

§ setLevel()

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

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