Changeset 2726


Ignore:
Timestamp:
31/08/2010 14:13:21 (18 months ago)
Author:
chris
Message:

Allow setting the verbosity level of bbstoreaccounts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • box/trunk/bin/bbstoreaccounts/bbstoreaccounts.cpp

    r2709 r2726  
    539539        // Filename for configuration file? 
    540540        std::string configFilename = BOX_GET_DEFAULT_BBACKUPD_CONFIG_FILE; 
     541        int logLevel = Log::EVERYTHING; 
    541542         
    542543        // See if there's another entry on the command line 
    543544        int c; 
    544         while((c = getopt(argc, (char * const *)argv, "c:m")) != -1) 
     545        while((c = getopt(argc, (char * const *)argv, "c:W:m")) != -1) 
    545546        { 
    546547                switch(c) 
     
    551552                        break; 
    552553                 
     554                case 'W': 
     555                        logLevel = Logging::GetNamedLevel(optarg); 
     556                        if(logLevel == Log::INVALID) 
     557                        { 
     558                                BOX_FATAL("Invalid logging level: " << optarg); 
     559                                return 2; 
     560                        } 
     561                        break; 
     562 
    553563                case 'm': 
    554564                        // enable machine readable output 
     
    561571                } 
    562572        } 
     573 
     574        Logging::FilterConsole((Log::Level) logLevel); 
     575        Logging::FilterSyslog (Log::NOTHING); 
     576 
    563577        // Adjust arguments 
    564578        argc -= optind; 
Note: See TracChangeset for help on using the changeset viewer.