[Jifty-commit] r5190 - in jifty/trunk: lib/Jifty/Plugin

Jifty commits jifty-commit at lists.jifty.org
Mon Mar 3 12:13:37 EST 2008


Author: alexmv
Date: Mon Mar  3 12:13:36 2008
New Revision: 5190

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/Plugin/Monitoring.pm

Log:
 r28227 at zoq-fot-pik:  chmrr | 2008-03-03 12:13:04 -0500
  * Less spastic logging for the monitoring plugin


Modified: jifty/trunk/lib/Jifty/Plugin/Monitoring.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/Monitoring.pm	(original)
+++ jifty/trunk/lib/Jifty/Plugin/Monitoring.pm	Mon Mar  3 12:13:36 2008
@@ -236,7 +236,7 @@
 
     my $unit = $self->monitors->{$name}->{unit};
     my $now = Jifty::DateTime->now->truncate( to => $unit );
-    warn "No last run time for monitor $name; inserting $now\n";
+    Jifty->log->warn("No last run time for monitor $name; inserting $now");
     $last->set_last_run($now);
     return $last;
 }
@@ -282,17 +282,15 @@
         my $last = $self->last_run($name);
         my %monitor = %{$self->monitors->{$name}};
         my $next = $last->last_run->add( $monitor{unit}."s" => $monitor{count} );
-        warn "For monitor $name, next $next, now $now\n";
         next unless $now >= $next;
-        warn "Cron not being run often enough: we skipped a '$name'!\n"
+        Jifty->log->warn("Cron not being run often enough: we skipped a '$name'!")
           if $now >= $next->add( $monitor{unit}."s" => $monitor{count} );
-        warn "Running monitor $name\n";
         $self->current_monitor(\%monitor);
         eval {
             $monitor{sub}->($self);
         };
         if (my $error = $@) {
-            warn "Error running monitor $name: $error\n";
+            Jifty->log->warn("Error running monitor $name: $error");
         } else {
             $last->set_last_run($now);
         }
@@ -304,7 +302,7 @@
     my $self = shift;
     return if -e $self->lockfile;
     unless (open PID, ">", $self->lockfile) {
-        warn "Can't open lockfile @{[$self->lockfile]}: $!";
+        Jifty->log->warn("Can't open lockfile @{[$self->lockfile]}: $!");
         return 0;
     }
     print PID $$;


More information about the Jifty-commit mailing list