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 |
############################################################################### |
############################################################################### |
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"); |