FIFE 2008.0
|
#include <logger.h>
Public Types | |
enum | LogLevel |
Public Member Functions | |
~LogManager () | |
void | log (LogLevel level, logmodule_t module, const std::string &msg) |
void | setLevelFilter (LogLevel level) |
LogLevel | getLevelFilter () |
void | addVisibleModule (logmodule_t module) |
void | removeVisibleModule (logmodule_t module) |
void | clearVisibleModules () |
bool | isVisible (logmodule_t module) |
void | setLogToPrompt (bool log_to_promt) |
bool | isLoggingToPrompt () |
void | setLogToFile (bool logtofile) |
bool | isLoggingToFile () |
std::string | getModuleName (logmodule_t module) |
Static Public Member Functions | |
static LogManager * | instance () |
FIFE::LogManager::~LogManager | ( | ) |
Destructor
Definition at line 73 of file logger.cpp.
void FIFE::LogManager::addVisibleModule | ( | logmodule_t | module | ) |
Adds visible module into logmanager Module corresponds some module in the engine. Modules may contain other modules. Modules and their structure is defined in file modules.h. In case module is not visible, LogManager filters corresponding log messages from output. In case some lower-level module is set visible, it also sets all upper level modules visible
module | module to set visible |
Definition at line 124 of file logger.cpp.
void FIFE::LogManager::clearVisibleModules | ( | ) |
LogManager::LogLevel FIFE::LogManager::getLevelFilter | ( | ) |
Gets currently used level filter.
Definition at line 120 of file logger.cpp.
std::string FIFE::LogManager::getModuleName | ( | logmodule_t | module | ) |
Gets display name for given module id E.g. LM_AUDIO -> "Audio"
Definition at line 217 of file logger.cpp.
LogManager * FIFE::LogManager::instance | ( | ) | [static] |
Returns instance to log manager. Log manager is a singleton class
Definition at line 66 of file logger.cpp.
Referenced by FIFE::Logger::log().
bool FIFE::LogManager::isLoggingToFile | ( | ) |
Tells if LogManager is set to log to a file
Definition at line 164 of file logger.cpp.
bool FIFE::LogManager::isLoggingToPrompt | ( | ) |
Tells if LogManager is set to log to prompt
Definition at line 148 of file logger.cpp.
bool FIFE::LogManager::isVisible | ( | logmodule_t | module | ) |
Tells if given module is visible
Definition at line 168 of file logger.cpp.
Referenced by log().
void FIFE::LogManager::log | ( | LogLevel | level, |
logmodule_t | module, | ||
const std::string & | msg | ||
) |
Logs given message
level | level of this log (e.g. warning) |
module | module where this log message is coming from. Modules are defined in modules.h-file |
msg | message to log |
Definition at line 78 of file logger.cpp.
References isVisible().
Referenced by FIFE::Logger::log().
void FIFE::LogManager::removeVisibleModule | ( | logmodule_t | module | ) |
void FIFE::LogManager::setLevelFilter | ( | LogLevel | level | ) |
Sets currently used level filter. For usage,
Definition at line 116 of file logger.cpp.
void FIFE::LogManager::setLogToFile | ( | bool | logtofile | ) |
Sets LogManager to log to a file
Definition at line 152 of file logger.cpp.
void FIFE::LogManager::setLogToPrompt | ( | bool | log_to_promt | ) |
Sets LogManager to log to prompt
Definition at line 144 of file logger.cpp.