summaryrefslogtreecommitdiff
path: root/bin/bbstored/BBStoreDHousekeeping.cpp
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2007-07-31 23:18:05 +0000
committerChris Wilson <chris+github@qwirx.com>2007-07-31 23:18:05 +0000
commit0b2fd98dd63c533e00c0d61ce022f37ee75857cc (patch)
tree5daa2a50b28b572e01281b622fee3adf818f5075 /bin/bbstored/BBStoreDHousekeeping.cpp
parent05db569d4efc62eaa10597142b8eac4937421e14 (diff)
Replace almost all calls to syslog() with logging framework. (refs #3)
Diffstat (limited to 'bin/bbstored/BBStoreDHousekeeping.cpp')
-rw-r--r--bin/bbstored/BBStoreDHousekeeping.cpp33
1 files changed, 19 insertions, 14 deletions
diff --git a/bin/bbstored/BBStoreDHousekeeping.cpp b/bin/bbstored/BBStoreDHousekeeping.cpp
index a4b26a93..16a1432a 100644
--- a/bin/bbstored/BBStoreDHousekeeping.cpp
+++ b/bin/bbstored/BBStoreDHousekeeping.cpp
@@ -11,10 +11,6 @@
#include <stdio.h>
-#ifdef HAVE_SYSLOG_H
- #include <syslog.h>
-#endif
-
#include "BackupStoreDaemon.h"
#include "BackupStoreAccountDatabase.h"
#include "BackupStoreAccounts.h"
@@ -82,7 +78,7 @@ void BackupStoreDaemon::RunHousekeepingIfNeeded()
// Store the time
mLastHousekeepingRun = timeNow;
- ::syslog(LOG_INFO, "Starting housekeeping");
+ BOX_INFO("Starting housekeeping");
// Get the list of accounts
std::vector<int32_t> accounts;
@@ -112,18 +108,25 @@ void BackupStoreDaemon::RunHousekeepingIfNeeded()
}
catch(BoxException &e)
{
- ::syslog(LOG_ERR, "while housekeeping account %08X, exception %s (%d/%d) -- aborting housekeeping run for this account",
- *i, e.what(), e.GetType(), e.GetSubType());
+ BOX_ERROR("Housekeeping on account " <<
+ BOX_FORMAT_ACCOUNT(*i) << " threw exception, "
+ "aborting run for this account: " <<
+ e.what() << " (" <<
+ e.GetType() << "/" << e.GetSubType() << ")");
}
catch(std::exception &e)
{
- ::syslog(LOG_ERR, "while housekeeping account %08X, exception %s -- aborting housekeeping run for this account",
- *i, e.what());
+ BOX_ERROR("Housekeeping on account " <<
+ BOX_FORMAT_ACCOUNT(*i) << " threw exception, "
+ "aborting run for this account: " <<
+ e.what());
}
catch(...)
{
- ::syslog(LOG_ERR, "while housekeeping account %08X, unknown exception -- aborting housekeeping run for this account",
- *i);
+ BOX_ERROR("Housekeeping on account " <<
+ BOX_FORMAT_ACCOUNT(*i) << " threw exception, "
+ "aborting run for this account: "
+ "unknown exception");
}
int64_t timeNow = GetCurrentBoxTime();
@@ -144,7 +147,7 @@ void BackupStoreDaemon::RunHousekeepingIfNeeded()
}
}
- ::syslog(LOG_INFO, "Finished housekeeping");
+ BOX_INFO("Finished housekeeping");
// Placed here for accuracy, if StopRun() is true, for example.
SetProcessTitle("housekeeping, idle");
@@ -190,7 +193,7 @@ bool BackupStoreDaemon::CheckForInterProcessMsg(int AccountNum, int MaximumWaitT
std::string line;
if(mInterProcessComms.GetLine(line, false /* no pre-processing */, MaximumWaitTime))
{
- TRACE1("housekeeping received command '%s' over interprocess comms\n", line.c_str());
+ TRACE1("Housekeeping received command '%s' over interprocess comms\n", line.c_str());
int account = 0;
@@ -212,7 +215,9 @@ bool BackupStoreDaemon::CheckForInterProcessMsg(int AccountNum, int MaximumWaitT
if(account == AccountNum)
{
// Yes! -- need to stop now so when it retries to get the lock, it will succeed
- ::syslog(LOG_INFO, "Housekeeping giving way to connection for account 0x%08x", AccountNum);
+ BOX_INFO("Housekeeping on account " <<
+ BOX_FORMAT_ACCOUNT(AccountNum) <<
+ "giving way to client connection");
return true;
}
}