From 7a3bf2431b20ce0bfa7ec1cbc782975e687ef4d7 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Tue, 14 Jan 2003 06:27:41 +0000 Subject: Documenting new requirements Reopen log on SIGHUP --- Echolot/Log.pm | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'Echolot') diff --git a/Echolot/Log.pm b/Echolot/Log.pm index 9eb7d9f..a91ac08 100644 --- a/Echolot/Log.pm +++ b/Echolot/Log.pm @@ -1,7 +1,7 @@ package Echolot::Log; # (c) 2002 Peter Palfrader -# $Id: Log.pm,v 1.1 2003/01/14 05:26:14 weasel Exp $ +# $Id: Log.pm,v 1.2 2003/01/14 06:27:41 weasel Exp $ # =pod @@ -37,10 +37,8 @@ sub header_log(%) { return $logstring; }; -sub init(%) { - my (%args) = @_; - - $LOG = Log::Dispatch->new( callbacks => \&header_log ); +sub reopen() { + $LOG->remove( 'file1' ); $LOG->add( Log::Dispatch::File->new( name => 'file1', min_level => 'debug', @@ -49,9 +47,12 @@ sub init(%) { )); }; -#sub log() { -# return $LOG; -#}; +sub init(%) { + my (%args) = @_; + + $LOG = Log::Dispatch->new( callbacks => \&header_log ); + reopen(); +}; sub debug($) { $LOG->debug(@_); -- cgit v1.2.3