diff options
author | Chris Wilson <chris+github@qwirx.com> | 2010-08-31 13:13:21 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2010-08-31 13:13:21 +0000 |
commit | fbf3b103e1a94be942905f0d16278baa7aef3fed (patch) | |
tree | f8b6b043f7961511f4c695bb7d9c6e9f23f86adc /bin/bbstoreaccounts | |
parent | 599b0fda83f9375c6143df70a32076c42b0e9308 (diff) |
Allow setting the verbosity level of bbstoreaccounts.
Diffstat (limited to 'bin/bbstoreaccounts')
-rw-r--r-- | bin/bbstoreaccounts/bbstoreaccounts.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/bin/bbstoreaccounts/bbstoreaccounts.cpp b/bin/bbstoreaccounts/bbstoreaccounts.cpp index 318f9725..9a54bd2a 100644 --- a/bin/bbstoreaccounts/bbstoreaccounts.cpp +++ b/bin/bbstoreaccounts/bbstoreaccounts.cpp @@ -538,10 +538,11 @@ int main(int argc, const char *argv[]) // Filename for configuration file? std::string configFilename = BOX_GET_DEFAULT_BBACKUPD_CONFIG_FILE; + int logLevel = Log::EVERYTHING; // See if there's another entry on the command line int c; - while((c = getopt(argc, (char * const *)argv, "c:m")) != -1) + while((c = getopt(argc, (char * const *)argv, "c:W:m")) != -1) { switch(c) { @@ -550,6 +551,15 @@ int main(int argc, const char *argv[]) configFilename = optarg; break; + case 'W': + logLevel = Logging::GetNamedLevel(optarg); + if(logLevel == Log::INVALID) + { + BOX_FATAL("Invalid logging level: " << optarg); + return 2; + } + break; + case 'm': // enable machine readable output sMachineReadableOutput = true; @@ -560,6 +570,10 @@ int main(int argc, const char *argv[]) PrintUsageAndExit(); } } + + Logging::FilterConsole((Log::Level) logLevel); + Logging::FilterSyslog (Log::NOTHING); + // Adjust arguments argc -= optind; argv += optind; |