[PATCH] Move warning about GTop not being enabled to stats output

Alex Vandiver alexmv at bestpractical.com
Mon Apr 12 18:52:03 UTC 2010


Don't spew a warning to STDERR about something which is an optional
dependency, and whose lack in no way negatively affects the
functioning of the program.  Instead, move the warning to the
statistics output, where it is potentially relevant.  Additionally,
mention that GTop would provide memory usage statistics, which is not
necessarily obvious to the casual user.
---
 lib/Brackup/BackupStats.pm |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/Brackup/BackupStats.pm b/lib/Brackup/BackupStats.pm
index ee0ad81..d9d0371 100644
--- a/lib/Brackup/BackupStats.pm
+++ b/lib/Brackup/BackupStats.pm
@@ -17,9 +17,6 @@ sub new {
         $self->{gtop_max} = 0;
         $self->{gtop_data} = Brackup::BackupStats::Data->new;
     }
-    else {
-        warn "GTop not found - skipping gtop stats\n";
-    }
 
     return bless $self, $class;
 }
@@ -66,6 +63,9 @@ sub print {
         printf $fh $fmt, 
             'Peak Memory Usage:', sprintf('%0.1f MB', $self->{gtop_max} / (1024 * 1024));
         print $fh "${hash}\n";
+    } else {
+        print $fh "${hash}GTop not installed, memory usage stats disabled\n";
+        print $fh "${hash}\n";
     }
 
     my $data = $self->{data};
-- 
1.7.0.4



More information about the brackup mailing list