#ifndef _LOGGINGGLOBAL_H
#define _LOGGINGGLOBAL_H

#include "EngineEnums.h"

namespace Engine {

/** \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);
/** \brief Sets the filename to which all the logging is sent, set to NULL to disable logging */
void SetLogFilename (const std::string &filename);

/** \brief Sends the Message to the Logging system
 *
 * \note The program automatically abortst when reporting an error
 */
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 */
