diff options
| author | fukachan <fukachan> | 2002-09-11 15:25:27 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2002-09-11 15:25:27 +0000 |
| commit | fbe0a828232a9e2dc342141f75cc2ccab7d098d5 (patch) | |
| tree | 639bbde5e8771ed42d43f4d4d0d831578f86c187 /fml/lib/FML/Log.pm | |
| parent | 20b161d2f7a1e1a2843628b2589cd78b9b5fac39 (diff) | |
| download | fml8-fbe0a828232a9e2dc342141f75cc2ccab7d098d5.tar.gz fml8-fbe0a828232a9e2dc342141f75cc2ccab7d098d5.tar.bz2 fml8-fbe0a828232a9e2dc342141f75cc2ccab7d098d5.zip | |
not use /dev/stderr
Diffstat (limited to 'fml/lib/FML/Log.pm')
| -rw-r--r-- | fml/lib/FML/Log.pm | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/fml/lib/FML/Log.pm b/fml/lib/FML/Log.pm index 6e38ebff..b2399a4f 100644 --- a/fml/lib/FML/Log.pm +++ b/fml/lib/FML/Log.pm @@ -2,7 +2,7 @@ # # Copyright (C) 2000,2001,2002 Ken'ichi Fukamachi # -# $FML: Log.pm,v 1.19 2002/07/02 03:54:18 fukachan Exp $ +# $FML: Log.pm,v 1.20 2002/07/31 13:00:19 fukachan Exp $ # package FML::Log; @@ -107,10 +107,17 @@ sub Log # When the second argument is not defined, use the default log_file. my $style = $config->{ log_format_type } || 'fml4_compatible'; - my $file = $log_file || $config->{ log_file } || '/dev/stderr'; - my $fh = new FileHandle ">> $file"; + my $file = $log_file || $config->{ log_file } || undef; + my $fh = undef; my $sender = FML::Credential->sender; + if (defined $file && -f $file) { + $fh = new FileHandle ">> $file"; + } + else { + $fh = \*STDERR; + } + if (defined $fh) { if ($style eq 'fml4_compatible') { print $fh $rdate->{'log_file_style'}, " ", $mesg; |
