From 7e27be36d95a5ce31180530a05a3f7c93c978cad Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Mon, 23 Apr 2018 15:55:13 -0700 Subject: [PATCH] modules/console: Add log mask cmd suite; recategorize log mark cmd under log. --- modules/console.cc | 56 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 51 insertions(+), 5 deletions(-) diff --git a/modules/console.cc b/modules/console.cc index 988ae3a0d..b417a3d01 100644 --- a/modules/console.cc +++ b/modules/console.cc @@ -365,18 +365,64 @@ console_cmd__debug(opt &out, const string_view &line) } } -bool -console_cmd__mark(opt &out, const string_view &line) -{ - log::mark(line); +// +// log +// - out << "The log files were marked with '" << line +bool +console_cmd__log__mask(opt &out, const string_view &line) +{ + thread_local string_view list[64]; + const auto &count + { + tokens(line, ' ', list) + }; + + log::console_mask({list, count}); + return true; +} + +bool +console_cmd__log__unmask(opt &out, const string_view &line) +{ + thread_local string_view list[64]; + const auto &count + { + tokens(line, ' ', list) + }; + + log::console_unmask({list, count}); + return true; +} + +bool +console_cmd__log__mark(opt &out, const string_view &line) +{ + const string_view &msg + { + empty(line)? + "marked by console": + line + }; + + log::mark + { + msg + }; + + out << "The log files were marked with '" << msg << "'" << std::endl; return true; } +bool +console_cmd__mark(opt &out, const string_view &line) +{ + return console_cmd__log__mark(out, line); +} + // // info //