--- nfo/perl/libs/Log/Dispatch/Configurator/Hardwired.pm 2003/02/18 18:47:36 1.1 +++ nfo/perl/libs/Log/Dispatch/Configurator/Hardwired.pm 2003/12/05 05:08:01 1.3 @@ -1,7 +1,13 @@ ## -------------------------------------------------------------------------------- -## $Id: Hardwired.pm,v 1.1 2003/02/18 18:47:36 joko Exp $ +## $Id: Hardwired.pm,v 1.3 2003/12/05 05:08:01 joko Exp $ ## -------------------------------------------------------------------------------- ## $Log: Hardwired.pm,v $ +## Revision 1.3 2003/12/05 05:08:01 joko +## + enhanced: more flexible - completely dis-/enable logging - don't do any logging when running tests +## +## Revision 1.2 2003/05/13 09:35:13 joko +## fixed log message +## ## Revision 1.1 2003/02/18 18:47:36 joko ## + initial commit ## @@ -24,14 +30,23 @@ sub get_attrs_global { my $self = shift; + my @dispatchers; + my @verbose; # push all loggers to @dispatchers - push @dispatchers, 'screen'; + if (not $main::LOG_SCREEN_SUPPRESS and not $ENV{LOG_SCREEN_SUPPRESS}) { + push @dispatchers, 'screen'; + push @verbose, 'screen:STDOUT'; + } + #print "logfile: ", $self->{logfile}, "\n"; - push @dispatchers, 'file' if ($self->{file_filename}); + if (not $main::LOG_FILE_SUPPRESS and not $ENV{LOG_FILE_SUPPRESS}) { + push @dispatchers, 'file' if ($self->{file_filename}); + push @verbose, "file:" . $self->{file_filename} if $self->{file_filename}; + } - print "logging to [", join(" ", @dispatchers), "]", "\n" if ($self->{verbose}); + print STDERR "logging to [", join(" ", @verbose), "]", "\n" if ($self->{verbose}); return { format => undef, dispatchers => \@dispatchers,