From 95298c0a7bcf8b1e84e7592271b5e24c18e4de26 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 1 Dec 2008 22:17:52 +0000 Subject: Reduce severity of some log messages about notifying system administrator. It's not an error to have no NotifyScript. --- bin/bbackupd/BackupDaemon.cpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'bin/bbackupd') 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 && -- cgit v1.2.3