get rid of rang.hpp dependency through color_out.h

Removed indirect dependency on rang.hpp through color_out.h. Now only
remaining dependencies on rang.hpp are direct.

+ fixed escape sequence for foreground magenta
This commit is contained in:
Martin Pulec
2022-08-16 14:01:53 +02:00
parent 0b8cc39f9c
commit 65557d112d
20 changed files with 155 additions and 203 deletions

View File

@@ -207,7 +207,6 @@ bool parse_log_cfg(const char *conf_str,
assert(show_timestamps != nullptr);
using std::clog;
using std::cout;
static const struct { const char *name; int level; } mapping[] = {
{ "quiet", LOG_LEVEL_QUIET },
@@ -224,13 +223,13 @@ bool parse_log_cfg(const char *conf_str,
std::string_view cfg = conf_str;
if (cfg == "help") {
cout << "log level: [0-" << LOG_LEVEL_MAX;
col() << "log level: [0-" << LOG_LEVEL_MAX;
for (auto m : mapping) {
cout << "|" << m.name;
col() << "|" << m.name;
}
cout << "][+repeat][+/-timestamps]\n";
cout << BOLD("\trepeat") << " - print repeating log messages\n";
cout << BOLD("\ttimestamps") << " - enable/disable timestamps\n";
col() << "][+repeat][+/-timestamps]\n";
col() << TBOLD("\trepeat") << " - print repeating log messages\n";
col() << TBOLD("\ttimestamps") << " - enable/disable timestamps\n";
return false;
}