26 #ifndef __LOG__LOG_NEW_H__INCL__
27 #define __LOG__LOG_NEW_H__INCL__
47 NewLog(std::string logPath);
65 void Log(
const char* source,
const char* fmt, ... );
72 void Error(
const char* source,
const char* fmt, ... );
79 void Warning(
const char* source,
const char* fmt, ... );
86 void White(
const char* source,
const char* fmt, ... );
93 void Green(
const char* source,
const char* fmt, ... );
100 void Blue(
const char* source,
const char* fmt, ... );
107 void Magenta(
const char* source,
const char* fmt, ... );
114 void Yellow(
const char* source,
const char* fmt, ... );
121 void Cyan(
const char* source,
const char* fmt, ... );
130 void Debug(
const char* source,
const char* fmt, ... );
188 void PrintMsg(
Color color,
char pfx,
const char* source,
const char* fmt, va_list ap );
203 void Print(
const char* fmt, ... );
213 void PrintVa(
const char* fmt, va_list ap );
235 #ifdef HAVE_WINDOWS_H
236 const HANDLE mStdOutHandle;
239 const HANDLE mStdErrHandle;
244 static const char*
const COLOR_TABLE[
COLOR_COUNT ];
void PrintTime()
Prints current time.
void SetColor(Color color)
Sets the color of the output text.
void Cyan(const char *source, const char *fmt,...)
Logs a message to console in cyan.
void Blue(const char *source, const char *fmt,...)
Logs a message to console in blue.
void Debug(const char *source, const char *fmt,...)
Logs a debug message to file and console.
void Yellow(const char *source, const char *fmt,...)
Logs a message to console in yellow.
Mutex mMutex
Protection against concurrent log messages.
FILE * mLogfile
The active logfile.
Common wrapper for platform-specific mutexes.
void Magenta(const char *source, const char *fmt,...)
Logs a message to console in magenta.
void SetLogfileDefault(std::string logPath)
Sets the default logfile.
void Log(const char *source, const char *fmt,...)
Logs a message to file.
static const char *const COLOR_TABLE[COLOR_COUNT]
Color translation table.
time_t mTime
Current timestamp.
bool SetLogfile(const char *filename)
Sets the logfile to be used.
void SetTime(time_t time)
Sets the log system time every main loop.
void Warning(const char *source, const char *fmt,...)
Logs a warning message to file.
Color
A convenience color enum.
void InitializeLogging(std::string logPath)
Initializes and sets the Log file path.
NewLog()
Primary constructor, initializes logging.
a small and simple logging system.
~NewLog()
Destructor, closes the logfile.
void Green(const char *source, const char *fmt,...)
Logs a message to console in green.
void PrintVa(const char *fmt, va_list ap)
Prints a raw message.
void White(const char *source, const char *fmt,...)
Logs a message to console in white.
void PrintMsg(Color color, char pfx, const char *source, const char *fmt, va_list ap)
Prints a message.
void Error(const char *source, const char *fmt,...)
Logs error message to console and file.
Template used for singleton classes.
void Print(const char *fmt,...)
Prints a raw message.