/[meteor]/googlecode.com/svn/trunk/Meteor/Syslog.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /googlecode.com/svn/trunk/Meteor/Syslog.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 61 by andrew.betts, Wed Feb 27 13:55:35 2008 UTC revision 62 by andrew.betts, Thu Nov 27 00:33:21 2008 UTC
# Line 40  package Meteor::Syslog; Line 40  package Meteor::Syslog;
40  ###############################################################################  ###############################################################################
41    
42          $Meteor::Syslog::DEFAULT_FACILITY='daemon';          $Meteor::Syslog::DEFAULT_FACILITY='daemon';
43            
44            $Meteor::Syslog::_lasttimestamp=0;
45            $Meteor::Syslog::_lasttimestring="";
46          $Meteor::Syslog::_open=0;               # set to 1 by _open          $Meteor::Syslog::_open=0;               # set to 1 by _open
47                    
48  ###############################################################################  ###############################################################################
# Line 68  sub ::syslog { Line 70  sub ::syslog {
70          if($debug || $facility eq 'none')          if($debug || $facility eq 'none')
71          {          {
72                  $format=~s/\%m/$!/g;                  $format=~s/\%m/$!/g;
73                                                    
74                  my $time = ($::CONF{'LogTimeFormat'} eq 'unix') ? time : localtime(time);                  my $time = time;
75                                    if ($::CONF{'LogTimeFormat'} ne 'unix') {
76                            if ($Meteor::Syslog::_lasttimestamp != time) {
77                                    $Meteor::Syslog::_lasttimestring = localtime(time);
78                                    $Meteor::Syslog::_lasttimestamp = time;
79                            }
80                            $time = $Meteor::Syslog::_lasttimestring;
81                    }
82    
83                  print STDERR "$time\t$priority\t";                  print STDERR "$time\t$priority\t";
84                  print STDERR sprintf($format,@args);                  print STDERR sprintf($format,@args);
85                  print STDERR "\n" unless(substr($format,-1) eq "\n");                  print STDERR "\n" unless(substr($format,-1) eq "\n");

Legend:
Removed from v.61  
changed lines
  Added in v.62

  ViewVC Help
Powered by ViewVC 1.1.26