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/BackupStoreDaemon.cpp

    r1691 r1784  
    209209                                ::openlog("bbstored/hk", LOG_PID, LOG_LOCAL6); 
    210210                                // Log that housekeeping started 
    211                                 ::syslog(LOG_INFO, "Housekeeping process started"); 
     211                                BOX_INFO("Housekeeping process started"); 
    212212                                // Ignore term and hup 
    213213                                // Parent will handle these and alert the child via the socket, don't want to randomly die 
     
    282282        catch(BoxException &e) 
    283283        { 
    284                 ::syslog(LOG_ERR, "%s: disconnecting due to " 
    285                         "exception %s (%d/%d)", DaemonName(),  
    286                         e.what(), e.GetType(), e.GetSubType()); 
     284                BOX_ERROR("Error in child process, terminating connection: " << 
     285                        e.what() << " (" << e.GetType() << "/" <<  
     286                        e.GetSubType() << ")"); 
    287287        } 
    288288        catch(std::exception &e) 
    289289        { 
    290                 ::syslog(LOG_ERR, "%s: disconnecting due to " 
    291                         "exception %s", DaemonName(), e.what()); 
     290                BOX_ERROR("Error in child process, terminating connection: " << 
     291                        e.what()); 
    292292        } 
    293293        catch(...) 
    294294        { 
    295                 ::syslog(LOG_ERR, "%s: disconnecting due to " 
    296                         "unknown exception", DaemonName()); 
     295                BOX_ERROR("Error in child process, terminating connection: " << 
     296                        "unknown exception"); 
    297297        } 
    298298} 
     
    312312         
    313313        // Log the name 
    314         ::syslog(LOG_INFO, "Certificate CN: %s", clientCommonName.c_str()); 
     314        BOX_INFO("Client certificate CN: " << clientCommonName); 
    315315         
    316316        // Check it 
     
    358358{ 
    359359        // Log the amount of data transferred 
    360         ::syslog(LOG_INFO, "Connection statistics for %s: " 
    361                         "IN=%lld OUT=%lld TOTAL=%lld", commonName, 
    362                         (long long)s.GetBytesRead(),  
    363                         (long long)s.GetBytesWritten(), 
    364                         (long long)s.GetBytesRead() +  
    365                         (long long)s.GetBytesWritten()); 
    366 } 
     360        BOX_INFO("Connection statistics for " << commonName << ":" 
     361                " IN="  << s.GetBytesRead() << 
     362                " OUT=" << s.GetBytesWritten() << 
     363                " TOTAL=" << (s.GetBytesRead() + s.GetBytesWritten())); 
     364} 
Note: See TracChangeset for help on using the changeset viewer.