2010-04-14 20:13:19 +02:00
|
|
|
#ifndef _LOGGINGGLOBAL_H
|
|
|
|
#define _LOGGINGGLOBAL_H
|
2010-04-05 23:38:59 +02:00
|
|
|
|
2010-04-14 20:13:19 +02:00
|
|
|
#include "EngineEnums.h"
|
2010-04-05 23:38:59 +02:00
|
|
|
|
2010-04-14 20:13:19 +02:00
|
|
|
namespace Engine {
|
2010-04-05 23:38:59 +02:00
|
|
|
|
|
|
|
/** \brief Represents a log message along with its level
|
|
|
|
*/
|
|
|
|
struct LogEntry {
|
|
|
|
LogEntry (LogLevel level, const char* message) {
|
|
|
|
mLevel = level;
|
|
|
|
mMessage = message;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** \brief the level of the message */
|
|
|
|
LogLevel mLevel;
|
|
|
|
/** \brief the message itself */
|
|
|
|
const char *mMessage;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Global visible functions */
|
|
|
|
|
|
|
|
/** \brief Sets the level for which messages should be printed out */
|
|
|
|
void SetLogPrintLevel (LogLevel print_level);
|
2010-04-08 19:34:57 +02:00
|
|
|
/** \brief Sets the filename to which all the logging is sent, set to NULL to disable logging */
|
|
|
|
void SetLogFilename (const char *filename);
|
2010-04-05 23:38:59 +02:00
|
|
|
|
|
|
|
/** \brief Sends the Message to the Logging system */
|
|
|
|
void LogError (const char* str, ...);
|
|
|
|
/** \brief Sends the Message to the Logging system */
|
|
|
|
void LogWarning (const char* str, ...);
|
|
|
|
/** \brief Sends the Message to the Logging system */
|
|
|
|
void LogMessage (const char* str, ...);
|
|
|
|
/** \brief Sends the Message to the Logging system */
|
|
|
|
void LogDebug (const char* str, ...);
|
|
|
|
/** \brief Returns the last LogEntry sent to the Logging system */
|
|
|
|
const LogEntry &GetLastLogEntry ();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2010-04-14 20:13:19 +02:00
|
|
|
#endif /* _LOGGINGGLOBAL_H */
|