#include <cmath>
#include <exception>
#include <fstream>
#include <iostream>
#include <mutex>
#include <sstream>
#include <string>
#include <string_view>
#include "common.h"
Go to the source code of this file.
|
| enum | TermColor::Code {
TermColor::FG_RED = 31
, TermColor::FG_GREEN = 32
, TermColor::FG_YELLOW = 33
, TermColor::FG_BLUE = 34
,
TermColor::FG_CYAN = 36
, TermColor::FG_WHITE = 37
, TermColor::FG_GREY = 90
, TermColor::FG_DEFAULT = 39
,
TermColor::BG_RED = 41
, TermColor::BG_GREEN = 42
, TermColor::BG_YELLOW = 43
, TermColor::BG_BLUE = 44
,
TermColor::BG_CYAN = 46
, TermColor::BG_WHITE = 47
, TermColor::BG_GREY = 100
, TermColor::BG_DEFAULT = 49
} |
| |
◆ _write_log_err
| #define _write_log_err |
( |
|
level, |
|
|
|
x |
|
) |
| |
◆ do_assert
| #define do_assert |
( |
|
assertion, |
|
|
|
msg |
|
) |
| |
Value: do { \
if (!(assertion)) { \
std::cerr << "ASSERTION FAILED: " << msg << "\n\t" \
<< "." \
<<
"() in " << view_tail(__FILE__,
FILE_NAME_TAIL_LEN) <<
" :" << __LINE__ <<
"" << std::endl; \
throw std::runtime_error("ASSERTION FAILED!"); \
} \
} while (0)
#define FILE_NAME_TAIL_LEN
Definition: static-logger.hpp:46
Assert execuded at all times.
◆ do_assert_debug
| #define do_assert_debug |
( |
|
assertion, |
|
|
|
msg |
|
) |
| |
Value: do { \
do_assert(assertion, msg); \
} \
} while (0)
constexpr bool RUN_ASSERTS
If true the assertions will be executed.
Definition: static-logger.hpp:49
Assert execuded only if RUN_ASSERTS is true.
◆ do_assert_equals
| #define do_assert_equals |
( |
|
a, |
|
|
|
b, |
|
|
|
msg |
|
) |
| do_assert(a == b, msg); |
Assert on equals execuded at all times.
◆ FILE_NAME_TAIL_LEN
| #define FILE_NAME_TAIL_LEN 50 |
◆ SHLOG
Value: do { \
[[maybe_unused]] auto static_logger_lck{ lock_out() }; \
std::cout << x << std::endl; \
} while (0)
Undecorated log to the current log stream.
◆ SHLOG_D
| #define SHLOG_D |
( |
|
x | ) |
_dont_write_log_err |
◆ SHLOG_E
◆ SHLOG_E_THROW
| #define SHLOG_E_THROW |
( |
|
x | ) |
|
◆ SHLOG_I
| #define SHLOG_I |
( |
|
x | ) |
_dont_write_log_err |
◆ SHLOG_REQ
| #define SHLOG_REQ |
( |
|
id, |
|
|
|
x |
|
) |
| _dont_write_log_err |
◆ SHLOG_S
| #define SHLOG_S |
( |
|
x | ) |
_dont_write_log_err |
◆ SHLOG_UNREQ
| #define SHLOG_UNREQ |
( |
|
id, |
|
|
|
x |
|
) |
| _dont_write_log_err |
◆ SHLOG_W
| #define SHLOG_W |
( |
|
x | ) |
_dont_write_log_err |
◆ logger_mtx
Mutex for optional STDOUT/STDERR synchronization.
◆ RUN_ASSERTS
| constexpr bool RUN_ASSERTS = true |
|
constexpr |
If true the assertions will be executed.