|
OSVR-Core
|
Implementation. More...
#include "LogSinks.h"#include <osvr/Util/GetEnvironmentVariable.h>#include <osvr/Util/Log.h>#include <osvr/Util/Logger.h>#include <osvr/Util/LogConfig.h>#include <osvr/Util/PlatformConfig.h>#include <boost/filesystem.hpp>#include <spdlog/spdlog.h>#include <memory>#include <string>Namespaces | |
| osvr | |
| The main namespace for all C++ elements of the framework, internal and external. | |
| osvr::util | |
| The Util library: Functionality not necessarily coupled to any particular core library, serving more as a common base layer behind all systems. | |
Functions | |
| OSVR_UTIL_EXPORT LoggerPtr | osvr::util::log::make_logger (const std::string &logger_name) |
| Make (or get from the registry) a logger by name. More... | |
| OSVR_UTIL_EXPORT void | osvr::util::log::drop (const std::string &logger_name) |
| Drops a logger from the registry. More... | |
| OSVR_UTIL_EXPORT void | osvr::util::log::dropAll () |
| Removes all the registered loggers from the registry. More... | |
| OSVR_UTIL_EXPORT void | osvr::util::log::flush () |
| For implementations with a centralized logger registry, flush all logger sinks. More... | |
| OSVR_UTIL_EXPORT bool | osvr::util::log::tryInitializingLoggingWithBaseName (std::string const &baseName) |
| Attempt to initialize the logging system with the indicated base filename (will be stripped of all characters outside of [a-zA-Z0-9_]). More... | |
| OSVR_UTIL_EXPORT std::string | osvr::util::log::getLoggingDirectory (bool make_dir=false) |
Implementation.
| void osvr::util::log::drop | ( | const std::string & | logger_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.
| void osvr::util::log::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).
| void osvr::util::log::flush | ( | ) |
For implementations with a centralized logger registry, flush all logger sinks.
| LoggerPtr osvr::util::log::make_logger | ( | const std::string & | logger_name | ) |
Make (or get from the registry) a logger by name.
Always returns a valid pointer even on invalid input or state, though it may be a "fallback" logger.
| bool osvr::util::log::tryInitializingLoggingWithBaseName | ( | std::string const & | baseName | ) |
Attempt to initialize the logging system with the indicated base filename (will be stripped of all characters outside of [a-zA-Z0-9_]).
If it succeeds (because you called it before any logging calls occurred), it returns true.
Not typically needed, since the log file will usually be named using a sanitized version of the executable file name's stem, but provided just in case that's not a reasonable default.
1.8.12