32 lines
597 B
C++
32 lines
597 B
C++
#ifndef __LOG_H__
|
|
#define __LOG_H__
|
|
|
|
#include "Application.h"
|
|
|
|
#include <string>
|
|
#include <stdlib.h>
|
|
|
|
#define FPRNT(io,tag,message) fprintf(io, "[%s] %s\n", tag, message.c_str());
|
|
|
|
inline void fatalError(const std::string message)
|
|
{
|
|
FPRNT(stderr, "FATAL ERROR", message);
|
|
Application::getInstance().Exit();
|
|
}
|
|
|
|
inline void log_info(const std::string& message)
|
|
{
|
|
FPRNT(stdout, "Info", message);
|
|
}
|
|
|
|
inline void log_warn(const std::string& message)
|
|
{
|
|
FPRNT(stdout, "Warning", message);
|
|
}
|
|
|
|
inline void log_error(const std::string& message)
|
|
{
|
|
FPRNT(stdout, "Error", message);
|
|
}
|
|
#endif // __LOG_H__
|