diff options
author | Tom Smeding <tom@tomsmeding.com> | 2021-10-17 16:12:20 +0200 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2021-10-17 16:12:20 +0200 |
commit | 4fd25ec14b335414fd96105df6bed64f4882ed1a (patch) | |
tree | 1abf432203828de43359f97b018d70229d1f8b36 /multilog.cpp | |
parent | 006f8b49d9ebe1ca334b934d0a127c0029300871 (diff) |
params.h -> command-line arguments
Diffstat (limited to 'multilog.cpp')
-rw-r--r-- | multilog.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/multilog.cpp b/multilog.cpp index d2dce10..2d9f3d6 100644 --- a/multilog.cpp +++ b/multilog.cpp @@ -2,7 +2,6 @@ #include <string> #include <cassert> #include "multilog.h" -#include "params.h" static int uniqid() { @@ -12,7 +11,10 @@ static int uniqid() { MultiLog::Item::Item() - : id(uniqid()) {} + : id{uniqid()} {} + +MultiLog::MultiLog(bool fancy) + : fancy{fancy} {} int MultiLog::add(const string_view prefix) { lock_guard guard(mut); @@ -21,7 +23,7 @@ int MultiLog::add(const string_view prefix) { items.emplace_back(); items.back().line = prefix; - if (multilog_fancy) { + if (fancy) { cout << prefix << endl; } else { cout << "[" << items.back().id << "] " << prefix << endl; @@ -36,7 +38,7 @@ void MultiLog::append(int id, const string_view text) { size_t idx = findId(id); items[idx].line += text; - if (multilog_fancy) { + if (fancy) { redrawLine(idx); } else { cout << "[" << items[idx].id << "]... " << text << endl; |