diff options
| author | fukachan <fukachan> | 2002-05-29 16:34:26 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2002-05-29 16:34:26 +0000 |
| commit | 3a67e163c076e59603bc76046e943f6eeca04fe3 (patch) | |
| tree | f0ab4b67ef2a16135949e153a19d8985d1f20e0a | |
| parent | 388f0a6b215e201ab4a1df5719a9f3463af240ea (diff) | |
| download | fml8-3a67e163c076e59603bc76046e943f6eeca04fe3.tar.gz fml8-3a67e163c076e59603bc76046e943f6eeca04fe3.tar.bz2 fml8-3a67e163c076e59603bc76046e943f6eeca04fe3.zip | |
try to save the error message at /var/spool/ml/@log.crit@ if could
| -rw-r--r-- | fml/lib/FML/Process/Switch.pm | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/fml/lib/FML/Process/Switch.pm b/fml/lib/FML/Process/Switch.pm index 0d9c7611..edda2e7f 100644 --- a/fml/lib/FML/Process/Switch.pm +++ b/fml/lib/FML/Process/Switch.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Switch.pm,v 1.67 2002/04/25 04:46:09 fukachan Exp $ +# $FML: Switch.pm,v 1.68 2002/05/19 09:44:00 fukachan Exp $ # package FML::Process::Switch; @@ -183,6 +183,8 @@ sub main::Bootstrap2 my $reason = $@; if ($obj->can('help')) { eval $obj->help();}; + eval q{ __log($args, $reason);}; + if (defined( $main_cf->{ debug } ) || defined $options{debug}) { croak($reason); @@ -195,6 +197,28 @@ sub main::Bootstrap2 } +# Descriptions: try to save the error message +# Arguments: STR($s) +# Side Effects: save message to log file if could +# Return Value: none +sub __log +{ + my ($args, $s) = @_; + + eval q{ + use File::Spec; + use FileHandle; + my $dir = $args->{ ml_home_prefix }; + my $logf = File::Spec->catfile($dir, '@log.crit@'); + my $wh = new FileHandle ">> $logf"; + if (defined $wh) { + print $wh time, "\t", $s, "\n"; + $wh->close; + } + }; +} + + # Descriptions: analyze argument vector # Arguments: STR($myname) HASH_REF($main_cf) # Side Effects: none |
