diff options
| author | fukachan <fukachan> | 2001-02-05 10:20:08 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2001-02-05 10:20:08 +0000 |
| commit | 006e1452d50e53891895795e19432cab3369afd2 (patch) | |
| tree | e2af6f8876885aa1b90eecbd6408b37b90e1704a /fml/lib | |
| parent | 3a0379280ab079dab1ba365bdedd027ca4115924 (diff) | |
| download | fml8-006e1452d50e53891895795e19432cab3369afd2.tar.gz fml8-006e1452d50e53891895795e19432cab3369afd2.tar.bz2 fml8-006e1452d50e53891895795e19432cab3369afd2.zip | |
follow $config->{log_message_format}
Diffstat (limited to 'fml/lib')
| -rw-r--r-- | fml/lib/FML/Log.pm | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/fml/lib/FML/Log.pm b/fml/lib/FML/Log.pm index 98d238a8..ae2c9473 100644 --- a/fml/lib/FML/Log.pm +++ b/fml/lib/FML/Log.pm @@ -42,14 +42,23 @@ sub Log use FileHandle; # When the second argument is not defined, use the default log_file. + my $style = $config->{ log_message_format } || 'traditional'; my $file = $log_file || $config->{ log_file } || '/dev/stderr'; my $fh = new FileHandle ">> $file"; my $sender = FML::Credential->sender; if (defined $fh) { - print $fh $rdate->{'log_file_style'}, " ", $mesg; - print $fh " ($sender)" if defined $sender; - print $fh "\n"; + if ($style eq 'traditional') { + print $fh $rdate->{'log_file_style'}, " ", $mesg; + print $fh " ($sender)" if defined $sender; + print $fh "\n"; + } + else { + my $name = $0; $name =~ s@.*/@@; + my $iam = $name."[". $config->{ pid } ."]"; + print $fh $rdate->{'log_file_style'}, " ", $iam, " ", $mesg; + print $fh "\n"; + } } else { croak "Error: cannot open $file\n"; |
