in reply to Re: Passing filename to Log::Std
in thread Passing filename to Log::Std
sub StartLogging { our $ref = shift @_; # ref to config hash our ($file, $level); BEGIN { $file = $ref->{log}{file_base} . ".$ref->{hostname}{target}.$ +0.$$.log"; $level = $ref->{log}{level}; } if ( $ref->{log}{method} eq "StdLog" ) { print "Logging to file $file at minimum loglevel $level\n"; use Log::StdLog { level => $level, file => $file, }; #now, log messages can be written to {*STDLOG} my $print_rc = print {*STDLOG} warn => "warn - this is a test" +; } }
-- Burvil
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Passing filename to Log::Std
by chromatic (Archbishop) on Apr 12, 2006 at 21:51 UTC | |
|
Re^3: Passing filename to Log::Std
by borisz (Canon) on Apr 12, 2006 at 21:47 UTC | |
by bowei_99 (Friar) on Apr 12, 2006 at 22:33 UTC |