diff options
author | Chris Wilson <chris+github@qwirx.com> | 2008-12-01 22:17:52 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2008-12-01 22:17:52 +0000 |
commit | 95298c0a7bcf8b1e84e7592271b5e24c18e4de26 (patch) | |
tree | cc5bbf49ca0441a5a441972265322c4fb59d14de | |
parent | 53ebf1afe9f796d56af20040bde0893e46ad1b73 (diff) |
Reduce severity of some log messages about notifying system
administrator. It's not an error to have no NotifyScript.
-rw-r--r-- | bin/bbackupd/BackupDaemon.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/bin/bbackupd/BackupDaemon.cpp b/bin/bbackupd/BackupDaemon.cpp index 1762142b..1b00e398 100644 --- a/bin/bbackupd/BackupDaemon.cpp +++ b/bin/bbackupd/BackupDaemon.cpp @@ -2158,10 +2158,21 @@ void BackupDaemon::NotifySysadmin(SysadminNotifier::EventCode Event) !GetConfiguration().GetKeyValueBool("NotifyAlways")) { // Don't send lots of repeated messages + // Note: backup-start and backup-finish will always be + // logged, because mLastNotifiedEvent is never set to + // these values and therefore they are never "duplicates". if(mLastNotifiedEvent == Event) { - BOX_WARNING("Suppressing duplicate notification about " << - sEventNames[Event]); + if(Event == SysadminNotifier::BackupOK) + { + BOX_INFO("Suppressing duplicate notification " + "about " << sEventNames[Event]); + } + else + { + BOX_WARNING("Suppressing duplicate notification " + "about " << sEventNames[Event]); + } return; } } @@ -2174,7 +2185,7 @@ void BackupDaemon::NotifySysadmin(SysadminNotifier::EventCode Event) if(Event != SysadminNotifier::BackupStart && Event != SysadminNotifier::BackupFinish) { - BOX_ERROR("Not notifying administrator about event " + BOX_INFO("Not notifying administrator about event " << sEventNames[Event] << " -- set NotifyScript " "to do this in future"); } @@ -2186,7 +2197,7 @@ void BackupDaemon::NotifySysadmin(SysadminNotifier::EventCode Event) sEventNames[Event]); // Log what we're about to do - BOX_NOTICE("About to notify administrator about event " + BOX_INFO("About to notify administrator about event " << sEventNames[Event] << ", running script '" << script << "'"); @@ -2194,7 +2205,7 @@ void BackupDaemon::NotifySysadmin(SysadminNotifier::EventCode Event) int returnCode = ::system(script.c_str()); if(returnCode != 0) { - BOX_ERROR("Notify script returned error code: " << + BOX_WARNING("Notify script returned error code: " << returnCode << " ('" << script << "')"); } else if(Event != SysadminNotifier::BackupStart && |