From 139f61fdeba091a5ea7ca83b6856352fdfb94c93 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Tue, 27 Dec 2022 20:01:44 +0100 Subject: [PATCH] Added quiet command line option to disable logging --- src/main.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main.cc b/src/main.cc index f0104611..53d37c41 100644 --- a/src/main.cc +++ b/src/main.cc @@ -140,6 +140,7 @@ int main(int argc, const char *argv[]) bool show_version{false}; int verbose{0}; bool list_diagrams{false}; + bool quiet{false}; app.add_option( "-c,--config", config_path, "Location of configuration file"); @@ -152,7 +153,9 @@ int main(int argc, const char *argv[]) app.add_option("-t,--thread-count", thread_count, "Thread pool size (0 = hardware concurrency)"); app.add_flag("-V,--version", show_version, "Print version and exit"); - app.add_flag("-v,--verbose", verbose, "Verbose logging"); + app.add_flag("-v,--verbose", verbose, + "Verbose logging (use multiple times to increase - e.g. -vvv)"); + app.add_flag("-q,--quiet", quiet, "Minimal logging"); app.add_flag("-l,--list-diagrams", list_diagrams, "Print list of diagrams defined in the config file"); @@ -163,6 +166,11 @@ int main(int argc, const char *argv[]) return 0; } + verbose++; + + if (quiet) + verbose = 0; + clanguml::util::setup_logging(verbose); clanguml::config::config config;