fysxasteroids/engine/LoggingGlobal.h

48 lines
1.2 KiB
C
Raw Normal View History

2010-04-05 23:38:59 +02:00
#ifndef _LOGGINGLOBAL_H
#define _LOGGINGLOBAL_H
namespace Engine {
enum LogLevel {
LogLevelDebug = 0,
LogLevelWarning,
LogLevelMessage,
LogLevelError
};
/** \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 ();
}
#endif // _LOGGINGLOBAL_H