21#ifdef MECACELL_TERMINAL_COLORS
22const constexpr static char RESET[] =
"\033[0m";
23const constexpr static char BLACK[] =
"\033[30m";
24const constexpr static char RED[] =
"\033[31m";
25const constexpr static char GREEN[] =
"\033[32m";
26const constexpr static char YELLOW[] =
"\033[33m";
27const constexpr static char BLUE[] =
"\033[34m";
28const constexpr static char MAGENTA[] =
"\033[35m";
29const constexpr static char CYAN[] =
"\033[36m";
30const constexpr static char WHITE[] =
"\033[37m";
31const constexpr static char BOLDBLACK[] =
"\033[1m\033[30m";
32const constexpr static char BOLDRED[] =
"\033[1m\033[31m";
33const constexpr static char BOLDGREEN[] =
"\033[1m\033[32m";
34const constexpr static char BOLDYELLOW[] =
"\033[1m\033[33m";
35const constexpr static char BOLDBLUE[] =
"\033[1m\033[34m";
36const constexpr static char BOLDMAGENTA[] =
"\033[1m\033[35m";
37const constexpr static char BOLDCYAN[] =
"\033[1m\033[36m";
38const constexpr static char BOLDWHITE[] =
"\033[1m\033[37m";
40const constexpr static char RESET[] =
"";
41const constexpr static char BLACK[] =
"";
42const constexpr static char RED[] =
"";
43const constexpr static char GREEN[] =
"";
44const constexpr static char YELLOW[] =
"";
45const constexpr static char BLUE[] =
"";
46const constexpr static char MAGENTA[] =
"";
47const constexpr static char CYAN[] =
"";
48const constexpr static char WHITE[] =
"";
50const constexpr static char BOLDRED[] =
"";
72 std::ostringstream os;
77template <
typename T,
typename... Args> std::string
sublogger(T&& t, Args&&... args) {
78 std::ostringstream os;
79 os << t << sublogger(std::forward<Args>(args)...);
84#ifndef MECACELL_LOGGER_WARN_DISABLE
85 static constexpr const bool enabled =
true;
87 static constexpr const bool enabled =
false;
90 static constexpr const auto tag =
"⚠ ";
93#ifndef MECACELL_LOGGER_ERR_DISABLE
94 static constexpr const bool enabled =
true;
96 static constexpr const bool enabled =
false;
99 static constexpr const auto tag =
" ✖ ";
102#ifndef MECACELL_LOGGER_INF_DISABLE
105 static constexpr const bool enabled =
false;
108 static constexpr const auto tag =
"⟢ ";
111#ifndef MECACELL_LOGGER_DBG_DISABLE
114 static constexpr const bool enabled =
false;
117 static constexpr const auto tag =
"☵ ";
120#ifndef MECACELL_LOGGER_SUC_DISABLE
123 static constexpr const bool enabled =
false;
126 static constexpr const auto tag =
" ✓ ";
129template <
typename Type,
typename... Args>
void logger(Args&&... args) {
133 struct tm* timeinfo = localtime(&rawtime);
135 strftime(buffer, 80,
"%F %H:%M:%S", timeinfo);
137 std::ostringstream os;
138 os <<
BOLDBLACK <<
"[" << buffer <<
"]" <<
RESET << Type::color <<
" " << Type::tag
140 os << sublogger(std::forward<Args>(args)...) <<
std::endl;
this file contains various miscellanious utility functions & helpers *
const static constexpr char BLUE[]
const static constexpr char BOLDMAGENTA[]
const static constexpr char BLACK[]
const static constexpr char GREEN[]
const static constexpr char BOLDRED[]
const static constexpr char YELLOW[]
const static constexpr char BOLDBLACK[]
void logger(Args &&... args)
const static constexpr char MAGENTA[]
std::string sublogger(T &&t)
const static constexpr char BOLDYELLOW[]
const static constexpr char BOLDBLUE[]
const static constexpr char BOLDWHITE[]
const static constexpr char CYAN[]
const static constexpr char BOLDGREEN[]
const static constexpr char WHITE[]
const static constexpr char RED[]
const static constexpr char BOLDCYAN[]
const static constexpr char RESET[]
iostream cout
Standard output stream.
iostream cerr
Standard error stream.
iostream endl
End-of-line manipulator.
static constexpr const auto tag
static constexpr const bool enabled
static constexpr const auto color
static constexpr const auto tag
static constexpr const bool enabled
static constexpr const auto color
static constexpr const bool enabled
static constexpr const auto tag
static constexpr const auto color
static constexpr const bool enabled
static constexpr const auto color
static constexpr const auto tag
static constexpr const auto color
static constexpr const bool enabled
static constexpr const auto tag