fysxasteroids/engine/LoggingGlobal.h

46 lines
1.2 KiB
C
Raw Permalink Normal View History

#ifndef _LOGGINGGLOBAL_H
#define _LOGGINGGLOBAL_H
2010-04-05 23:38:59 +02:00
#include "EngineEnums.h"
2010-04-05 23:38:59 +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 std::string &filename);
2010-04-05 23:38:59 +02:00
/** \brief Sends the Message to the Logging system
*
* \note The program automatically abortst when reporting an error
*/
2010-04-05 23:38:59 +02:00
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 /* _LOGGINGGLOBAL_H */