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 |
############################################################################### |
############################################################################### |
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 |
} |
} |
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; |