15#ifndef BASE_FAIRLOGGER_H_
16#define BASE_FAIRLOGGER_H_
19#include <fairlogger/Logger.h>
24#define MESSAGE_ORIGIN __FILE__, CONVERTTOSTRING(__LINE__), __FUNCTION__
41static const char*
const LogLevelString[] =
42 {
"FATAL",
"ERROR",
"WARNING",
"INFO",
"DEBUG",
"DEBUG1",
"DEBUG2",
"DEBUG3",
"DEBUG4"};
52 fair::Logger::SetConsoleSeverity(fConsoleSeverity);
54 fair::Logger::SetConsoleSeverity(fair::Severity::fatal);
61 fair::Logger::SetConsoleSeverity(fConsoleSeverity);
67 fair::Logger::SetFileSeverity(fLogFileSeverity);
69 fair::Logger::SetFileSeverity(fair::Severity::fatal);
76 fair::Logger::SetFileSeverity(fLogFileSeverity);
91 deprecated(
"Use 'IsLogNeeded(fair::Severity severity)' or 'fair::Logger::Logging(const fair::Severity "
92 "severity)' or 'fair::Logger::Logging(const std::string& severityStr)'")));
94 void Fatal(
const char* file,
const char* line,
const char*
func,
const char*
format, ...)
96 void Error(const
char* file, const
char* line, const
char*
func, const
char*
format, ...)
98 void Warning(const
char* file, const
char* line, const
char*
func, const
char*
format, ...)
100 void Info(const
char* file, const
char* line, const
char*
func, const
char*
format, ...)
102 void Debug(const
char* file, const
char* line, const
char*
func, const
char*
format, ...)
104 void Debug1(const
char* file, const
char* line, const
char*
func, const
char*
format, ...)
106 void Debug2(const
char* file, const
char* line, const
char*
func, const
char*
format, ...)
108 void Debug3(const
char* file, const
char* line, const
char*
func, const
char*
format, ...)
110 void Debug4(const
char* file, const
char* line, const
char*
func, const
char*
format, ...)
114 deprecated("Line break is now added automatically by the
LOG macro, this variable only adds
empty space.")));
116 deprecated("Data is now flushed automatically by the
LOG macro, this variable only adds
empty space.")));
129 void Log(fair::Severity
level,
138 static void LogFatalMessage();
140 void OpenLogFile() { fair::Logger::InitFileSink(fLogFileSeverity, fLogFileName,
false); }
142 void CloseLogFile() { fair::Logger::RemoveFileSink(); }
144 std::string fLogFileName;
145 std::string fLogFileSeverity;
146 std::string fConsoleSeverity;
149 int fBufferSizeNeeded;
150 std::vector<char> fDynamicBuffer;
151 char* fBufferPointer;
156#define gLogger (FairLogger::GetLogger())
char error[CURL_ERROR_SIZE]
void Debug3(const char *file, const char *line, const char *func, const char *format,...) __attribute__((deprecated("Use 'LOG(debug3) << content
void SetLogVerbosityLevel(const char *verbosity)
void SetLogScreenLevel(const char *severity)
void SetLogFileName(const std::string &name)
void Debug(const char *file, const char *line, const char *func, const char *format,...) __attribute__((deprecated("Use 'LOG(debug) << content
void Debug1(const char *file, const char *line, const char *func, const char *format,...) __attribute__((deprecated("Use 'LOG(debug1) << content
void Debug2(const char *file, const char *line, const char *func, const char *format,...) __attribute__((deprecated("Use 'LOG(debug2) << content
static FairLogger * GetLogger()
void SetLogFileLevel(const char *severity)
void SetScreenStreamToCerr(bool)
void Error(const char *file, const char *line, const char *func, const char *format,...) __attribute__((deprecated("Use 'LOG(error) << content
void SetLogToScreen(bool enabled)
void SetColoredLog(bool enabled)
bool IsLogNeeded(fair::Severity severity)
void SetLogToFile(bool enabled)
void Info(const char *file, const char *line, const char *func, const char *format,...) __attribute__((deprecated("Use 'LOG(info) << content
bool IsLogNeeded(FairLogLevel level) __attribute__((deprecated("Use 'IsLogNeeded(fair macro interface instead
void Debug4(const char *file, const char *line, const char *func, const char *format,...) __attribute__((deprecated("Use 'LOG(debug4) << content
void Warning(const char *file, const char *line, const char *func, const char *format,...) __attribute__((deprecated("Use 'LOG(warn) << content
GLuint const GLchar * name
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLint GLint GLsizei GLint GLenum format
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"