9static const int LOG_EXTENSIVE = 0;
10static const int LOG_VERBOSE = 1;
11static const int LOG_DEBUG = 2;
12static const int LOG_INFO = 3;
13static const int LOG_NOTE = 4;
14static const int LOG_WARNING = 5;
15static const int LOG_ERROR = 6;
16static const int LOG_FATAL = 7;
17static const int LOG_SILENT = 8;
54 static
int openLogFile(const
char* filename) noexcept;
61string format_log_message(const
char* prefix, const
char* format, va_list* args);
69void output(
int log_level, const
char* format, va_list* args)
81void output(
int log_level,
const char* format, ...)
91void extensive(
const char* format, ...) noexcept;
97void verbose(const
char* format, ...) noexcept;
103void debug(const
char* format, ...) noexcept;
109void info(const
char* format, ...) noexcept;
115void note(const
char* format, ...) noexcept;
121void warning(const
char* format, ...) noexcept;
127void error(const
char* format, ...) noexcept;
134void check_fatal(
bool condition, const
char* format, ...)
145void check_equal(
const MathSize lhs,
const MathSize rhs,
const char* name)
156void check_equal(
const char* lhs,
const char* rhs,
const char* name)
168void check_equal(
const V& lhs,
const V& rhs,
const char* name)
173 logging::check_fatal(lhs != rhs,
174 "Expected %s to be %d but got %d",
184void fatal(
const char* format, ...)
193void fatal(
const std::exception& ex);
200void fatal(
const std::exception& ex,
const char* format, ...);
211T fatal(
const char* format, va_list* args)
217 auto msg = format_log_message(
"", format, args);
218 output(LOG_FATAL, msg.c_str());
224 throw std::runtime_error(msg);
235T fatal(
const char* format, ...)
241 va_start(args, format);
243 return fatal<T>(format, &args);
249 virtual string add_log(
const char* format)
const noexcept = 0;
250 void log_output(
const int level,
const char* format, ...)
const noexcept;
251 void log_extensive(
const char* format, ...)
const noexcept;
252 void log_verbose(
const char* format, ...)
const noexcept;
253 void log_debug(
const char* format, ...)
const noexcept;
254 void log_info(
const char* format, ...)
const noexcept;
255 void log_note(
const char* format, ...)
const noexcept;
256 void log_warning(
const char* format, ...)
const noexcept;
257 void log_error(
const char* format, ...)
const noexcept;
258 void log_check_fatal(
bool condition,
const char* format, ...)
const
263 void log_fatal(
const char* format, ...)
const
Provides logging functionality.
Definition Log.h:23
static int logging_level_
Current logging level.
Definition Log.h:27
static int closeLogFile() noexcept
Set output log file.
Definition Log.cpp:54
static int getLogLevel() noexcept
Get current logging level.
Definition Log.cpp:38
static void increaseLogLevel() noexcept
Increase amount of logging output by one level.
Definition Log.cpp:28
static void setLogLevel(int log_level) noexcept
Set logging level to a specific level.
Definition Log.cpp:24
static int openLogFile(const char *filename) noexcept
Set output log file.
Definition Log.cpp:43
static void decreaseLogLevel() noexcept
Decrease amount of logging output by one level.
Definition Log.cpp:33