mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-20 21:40:15 +00:00
Allow verbosity increase with -V
+ small updates
This commit is contained in:
@@ -181,16 +181,13 @@ void debug_dump(void *lp, int len)
|
||||
}
|
||||
|
||||
bool set_log_level(const char *optarg, bool *logger_repeat_msgs) {
|
||||
assert(optarg != nullptr);
|
||||
assert(logger_repeat_msgs != nullptr);
|
||||
|
||||
using namespace std::string_literals;
|
||||
using std::clog;
|
||||
using std::cout;
|
||||
|
||||
*logger_repeat_msgs = false;
|
||||
if (optarg == nullptr) {
|
||||
log_level = LOG_LEVEL_VERBOSE;
|
||||
return true;
|
||||
}
|
||||
|
||||
static const struct { const char *name; int level; } mapping[] = {
|
||||
{ "quiet", LOG_LEVEL_QUIET },
|
||||
{ "fatal", LOG_LEVEL_FATAL },
|
||||
@@ -204,7 +201,7 @@ bool set_log_level(const char *optarg, bool *logger_repeat_msgs) {
|
||||
};
|
||||
|
||||
if ("help"s == optarg) {
|
||||
cout << "log level: [0-8";
|
||||
cout << "log level: [0-" << LOG_LEVEL_MAX;
|
||||
for (auto m : mapping) {
|
||||
cout << "|" << m.name;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user