#include <OpenGUI_LogSystem.h>
Public Member Functions | |
| void | logMsg (std::string log, std::string message, unsigned int logLevel) |
| Send a message through the given log. | |
| LogMessage & | logMsg (std::string log, unsigned int logLevel) |
| A stream like interface for writing to logs. | |
| void | setLogListener (LogListener *listener) |
| Sets the used log listener to the given listener. Only 1 LogListener is used at a time. | |
| void | setLevel (unsigned int logLevel) |
| Sets the log level that is applied to all messages. This check occurs after the log specific checks. | |
| Log * | createLog (std::string name) |
| Explicitly create a new log. | |
| Log * | getLog (std::string name) |
| Get a log by name. | |
| void | destroyLog (std::string name) |
| Destroy a log by name. | |
Static Public Member Functions | |
| static LogManager & | getSingleton (void) |
| Retrieve the current singleton, if one exists. If none exists, this will cause an error. | |
| static LogManager * | getSingletonPtr (void) |
| Retrieve a pointer to the current singleton, if one exists. If none exists, this will return 0. | |
| static LogMessage & | SlogMsg (std::string log, unsigned int logLevel) |
| Same as logMsg, but implemented as a static function, with automatic singleton dereferencing. Should help make your code a little smaller. | |
| Log * OpenGUI::LogManager::createLog | ( | std::string | name | ) |
| void OpenGUI::LogManager::destroyLog | ( | std::string | name | ) |
Destroy a log by name.
| Log * OpenGUI::LogManager::getLog | ( | std::string | name | ) |
Get a log by name.
| LogManager & OpenGUI::LogManager::getSingleton | ( | void | ) | [static] |
Retrieve the current singleton, if one exists. If none exists, this will cause an error.
| LogManager * OpenGUI::LogManager::getSingletonPtr | ( | void | ) | [static] |
Retrieve a pointer to the current singleton, if one exists. If none exists, this will return 0.
| LogMessage & OpenGUI::LogManager::logMsg | ( | std::string | log, | |
| unsigned int | logLevel | |||
| ) |
A stream like interface for writing to logs.
This should be pretty simple to use for just about everyone. Works just like standard C++ stream (since it is based off of them). myLogmanagerPtr->logMsg("myLog", 1) << "Here is my log entry, and the number " << 4 << Log::end;
| void OpenGUI::LogManager::logMsg | ( | std::string | log, | |
| std::string | message, | |||
| unsigned int | logLevel | |||
| ) |
Send a message through the given log.
This is equivalent to getLog(log)->write(message, logLevel);
If log does not yet exist, it will be created.
| void OpenGUI::LogManager::setLevel | ( | unsigned int | logLevel | ) |
Sets the log level that is applied to all messages. This check occurs after the log specific checks.
| void OpenGUI::LogManager::setLogListener | ( | LogListener * | listener | ) |
Sets the used log listener to the given listener. Only 1 LogListener is used at a time.
If you want more than 1 output stream, do it in a custom LogListener.
| static LogMessage& OpenGUI::LogManager::SlogMsg | ( | std::string | log, | |
| unsigned int | logLevel | |||
| ) | [inline, static] |
Same as logMsg, but implemented as a static function, with automatic singleton dereferencing. Should help make your code a little smaller.