Ignore:
Timestamp:
01/08/2007 00:18:50 (5 years ago)
Author:
chris
Message:

Replace almost all calls to syslog() with logging framework. (merges [1783])

File:
1 edited

Legend:

Unmodified
Added
Removed
  • box/chris/general/bin/bbstored/BBStoreDHousekeeping.cpp

    r1382 r1784  
    1111 
    1212#include <stdio.h> 
    13  
    14 #ifdef HAVE_SYSLOG_H 
    15         #include <syslog.h> 
    16 #endif 
    1713 
    1814#include "BackupStoreDaemon.h" 
     
    8379        // Store the time 
    8480        mLastHousekeepingRun = timeNow; 
    85         ::syslog(LOG_INFO, "Starting housekeeping"); 
     81        BOX_INFO("Starting housekeeping"); 
    8682 
    8783        // Get the list of accounts 
     
    113109                catch(BoxException &e) 
    114110                { 
    115                         ::syslog(LOG_ERR, "while housekeeping account %08X, exception %s (%d/%d) -- aborting housekeeping run for this account", 
    116                                 *i, e.what(), e.GetType(), e.GetSubType()); 
     111                        BOX_ERROR("Housekeeping on account " << 
     112                                BOX_FORMAT_ACCOUNT(*i) << " threw exception, " 
     113                                "aborting run for this account: " << 
     114                                e.what() << " (" << 
     115                                e.GetType() << "/" << e.GetSubType() << ")"); 
    117116                } 
    118117                catch(std::exception &e) 
    119118                { 
    120                         ::syslog(LOG_ERR, "while housekeeping account %08X, exception %s -- aborting housekeeping run for this account", 
    121                                 *i, e.what()); 
     119                        BOX_ERROR("Housekeeping on account " << 
     120                                BOX_FORMAT_ACCOUNT(*i) << " threw exception, " 
     121                                "aborting run for this account: " << 
     122                                e.what()); 
    122123                } 
    123124                catch(...) 
    124125                { 
    125                         ::syslog(LOG_ERR, "while housekeeping account %08X, unknown exception -- aborting housekeeping run for this account", 
    126                                 *i); 
     126                        BOX_ERROR("Housekeeping on account " << 
     127                                BOX_FORMAT_ACCOUNT(*i) << " threw exception, " 
     128                                "aborting run for this account: " 
     129                                "unknown exception"); 
    127130                } 
    128131         
     
    145148        } 
    146149                 
    147         ::syslog(LOG_INFO, "Finished housekeeping"); 
     150        BOX_INFO("Finished housekeeping"); 
    148151 
    149152        // Placed here for accuracy, if StopRun() is true, for example. 
     
    191194        if(mInterProcessComms.GetLine(line, false /* no pre-processing */, MaximumWaitTime)) 
    192195        { 
    193                 TRACE1("housekeeping received command '%s' over interprocess comms\n", line.c_str()); 
     196                TRACE1("Housekeeping received command '%s' over interprocess comms\n", line.c_str()); 
    194197         
    195198                int account = 0; 
     
    213216                        { 
    214217                                // Yes! -- need to stop now so when it retries to get the lock, it will succeed 
    215                                 ::syslog(LOG_INFO, "Housekeeping giving way to connection for account 0x%08x", AccountNum); 
     218                                BOX_INFO("Housekeeping on account " << 
     219                                        BOX_FORMAT_ACCOUNT(AccountNum) << 
     220                                        "giving way to client connection"); 
    216221                                return true; 
    217222                        } 
Note: See TracChangeset for help on using the changeset viewer.