/[cvs]/nfo/perl/scripts/outlook2ldap/libs/Torus/Logger.pm
ViewVC logotype

Annotation of /nfo/perl/scripts/outlook2ldap/libs/Torus/Logger.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations)
Sun Jan 19 03:35:26 2003 UTC (21 years, 5 months ago) by joko
Branch: MAIN
CVS Tags: v009, HEAD
Changes since 1.1: +19 -12 lines
+ added cvs-header

1 joko 1.2 ## ------------------------------------------------------------------------
2     ## $Id: Files.pm,v 1.2 2003/01/19 02:14:11 joko Exp $
3     ## ------------------------------------------------------------------------
4     ## $Log: Files.pm,v $
5     ## ------------------------------------------------------------------------
6    
7    
8     package Torus::Logger;
9    
10     use strict;
11     use warnings;
12    
13 joko 1.1 #require "$basepath/etc/log/Config.pm";
14     #BEGIN {
15     use FindBin qw($Bin);
16     #require "$Bin/use_libs.pl";
17     #}
18 joko 1.2
19    
20     use Log::Dispatch::Configurator::Hardwired;
21     use Log::Dispatch::Config;
22 joko 1.1
23     my $bool_quiet = grep /--quiet/, @ARGV;
24     my $bool_debug = grep /--debug/, @ARGV;
25     my $bool_verbose = grep /--verbose/, @ARGV;
26     configureLogDispatcher( { quiet => $bool_quiet, debug => $bool_debug, verbose => $bool_verbose } );
27 joko 1.2
28 joko 1.1 sub configureLogDispatcher {
29     my $args = shift;
30     my $logHandlerMeta = Log::Dispatch::Configurator::Hardwired->new();
31     # configure custom logHandler
32     #$logHandlerMeta->{file_filename} = "$basepath/var/log/logfile.txt";
33     $logHandlerMeta->{file_filename} = "$Bin/../var/log/logfile.txt";
34     $logHandlerMeta->{screen_min_level} = 'info';
35    
36     if ($args->{quiet}) {
37     $logHandlerMeta->{screen_min_level} = 8;
38     }
39    
40     if ($args->{debug}) {
41     $logHandlerMeta->{screen_min_level} = 'debug';
42     }
43    
44     if ($args->{verbose}) {
45     $logHandlerMeta->{verbose} = 1;
46     }
47    
48     Log::Dispatch::Config->configure($logHandlerMeta);
49     }
50 joko 1.2
51     1;

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed