diff options
author | Chris Wilson <chris+github@qwirx.com> | 2007-07-31 23:18:05 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2007-07-31 23:18:05 +0000 |
commit | 0b2fd98dd63c533e00c0d61ce022f37ee75857cc (patch) | |
tree | 5daa2a50b28b572e01281b622fee3adf818f5075 /bin/bbackupctl/bbackupctl.cpp | |
parent | 05db569d4efc62eaa10597142b8eac4937421e14 (diff) |
Replace almost all calls to syslog() with logging framework. (refs #3)
Diffstat (limited to 'bin/bbackupctl/bbackupctl.cpp')
-rw-r--r-- | bin/bbackupctl/bbackupctl.cpp | 33 |
1 files changed, 8 insertions, 25 deletions
diff --git a/bin/bbackupctl/bbackupctl.cpp b/bin/bbackupctl/bbackupctl.cpp index f0a966c4..a5dc4c10 100644 --- a/bin/bbackupctl/bbackupctl.cpp +++ b/bin/bbackupctl/bbackupctl.cpp @@ -162,7 +162,7 @@ int main(int argc, const char *argv[]) ); #if defined WIN32 && ! defined NDEBUG - syslog(LOG_ERR,"Failed to connect to the command socket"); + BOX_ERROR("Failed to connect to the command socket"); #endif return 1; @@ -175,29 +175,16 @@ int main(int argc, const char *argv[]) std::string configSummary; if(!getLine.GetLine(configSummary)) { -#if defined WIN32 && ! defined NDEBUG - syslog(LOG_ERR, "Failed to receive configuration summary " + BOX_ERROR("Failed to receive configuration summary " "from daemon"); -#else - printf("Failed to receive configuration summary from daemon\n"); -#endif - return 1; } // Was the connection rejected by the server? if(getLine.IsEOF()) { -#if defined WIN32 && ! defined NDEBUG - syslog(LOG_ERR, "Server rejected the connection. " - "Are you running bbackupctl as the same user " - "as the daemon?"); -#else - printf("Server rejected the connection. " - "Are you running bbackupctl as the same user " - "as the daemon?\n"); -#endif - + BOX_ERROR("Server rejected the connection. Are you running " + "bbackupctl as the same user as the daemon?"); return 1; } @@ -224,11 +211,7 @@ int main(int argc, const char *argv[]) std::string stateLine; if(!getLine.GetLine(stateLine) || getLine.IsEOF()) { -#if defined WIN32 && ! defined NDEBUG - syslog(LOG_ERR, "Failed to receive state line from daemon"); -#else - printf("Failed to receive state line from daemon\n"); -#endif + BOX_ERROR("Failed to receive state line from daemon"); return 1; } @@ -236,7 +219,7 @@ int main(int argc, const char *argv[]) int currentState; if(::sscanf(stateLine.c_str(), "state %d", ¤tState) != 1) { - printf("State line didn't decode\n"); + BOX_ERROR("Received invalid state line from daemon"); return 1; } @@ -266,8 +249,8 @@ int main(int argc, const char *argv[]) if(!autoBackup) { - printf("ERROR: Daemon is not in automatic mode -- " - "sync will never start!\n"); + BOX_ERROR("Daemon is not in automatic mode, " + "sync will never start!"); return 1; } |