/[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 47 by knops.gerd, Mon Feb 4 21:06:42 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 59  sub ::syslog { Line 61  sub ::syslog {
61          if($format eq '')          if($format eq '')
62          {          {
63                  my $txt=join("\t",@args);                  my $txt=join("\t",@args);
                   
64                  $format='%s';                  $format='%s';
65                  @args=($txt);                  @args=($txt);
66          }          }
# Line 69  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=time;                  my $time = time;
75                                    if ($::CONF{'LogTimeFormat'} ne 'unix') {
76                  print STDERR "$time\t$::PGM($priority): ";                          if ($Meteor::Syslog::_lasttimestamp != time) {
77                  print STDERR sprintf($format,@_);                                  $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";
84                    print STDERR sprintf($format,@args);
85                  print STDERR "\n" unless(substr($format,-1) eq "\n");                  print STDERR "\n" unless(substr($format,-1) eq "\n");
86                                    
87                  return;                  return;

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

  ViewVC Help
Powered by ViewVC 1.1.26