2 ##########################################################################
3 # yaala 0.7.3 2004-11-10 #
4 #---=============--------------------------------------------------------#
6 # Purpose: Generating statistics #
8 # Output: One or more HTML-files (depending on the output module) #
9 # Version: 0.7.3 (stable) #
11 # Homepage: http://yaala.org/ #
12 # Authors: Florian octo Forster <octo@verplant.org> #
13 # Contributions are listed in AUTHORS #
14 ##########################################################################
18 if ($0 =~ m#^(.*)[/\\]#) { chdir ($1); }
20 unshift (@::INC, 'lib');
22 # 0x010: lib/Data/Core.pm
23 # 0x020: lib/Data/Setup.pm
24 # 0x040: lib/Data/Convert.pm
25 # 0x080: lib/Data/Core.pm (dump any data stored!)
26 # 0x100: lib/Report/GDGraph.pm
27 # 0x200: lib/Data/Persistent.pm
43 use Yaala::Config qw#get_config parse_argv read_config#;
47 $HOMEPAGE = 'http://yaala.org/';
57 print STDERR $/, __FILE__, ': $Id: yaala,v 1.17 2004/11/10 10:07:43 octo Exp $' if ($DEBUG);
60 read_config (get_config ('config') ? get_config ('config') : 'config');
62 unless (get_config ('input'))
68 # report and data initialization needs parser module
69 my $logtype = get_config ('logtype');
70 my $report = get_config ('report' );
71 $logtype ||= 'Common';
72 $report ||= 'Combined';
73 $logtype = ucfirst (lc ($logtype));
74 $report = ucfirst (lc ($report ));
76 require "Yaala/Parser/$logtype.pm";
77 require "Yaala/Report/$report.pm";
78 import Yaala::Parser qw#parse extra#;
79 import Yaala::Report qw#generate#;
81 print STDERR $/, __FILE__, ": Accumulating data.." if ($DEBUG);
83 my $num_read_files = 0;
85 for (get_config ('input'))
88 if (open (LOGFILE, '< ' . $_))
90 print STDERR $/, __FILE__, qq#: Reading "$_"# if ($DEBUG);
93 parse ($_) while (<LOGFILE>);
99 print STDERR $/, __FILE__, qq#: Error opening "$_": $!#;
102 if (!$num_read_files)
104 print STDERR $/, __FILE__, ": Could not read any files. Exiting.\n";
110 print STDERR $/, __FILE__, ': Generating pages..' if ($DEBUG);
113 print STDERR $/, __FILE__, ": Exiting.." if ($DEBUG);
117 ##################################################
118 # end of main program #
119 #---=====================------------------------#
120 # surprised?? well, it's pretty short, cause all #
121 # the _real_ work is done in the the modules. #
122 # If you write a modul by your own: PLEASE send #
123 # me a copy so that i can include it in the #
125 # And how about 12 modules at a time ? -- qmax #
126 # Awesome :) -- octo #
127 ##################################################
133 Usage: $0 [--<key> <value>] file1 .. fileN
136 --config Specify alternate config file
137 --directory yaala will write all generated files to this
138 directory (and overwrite existing ones without
140 --report Selects the report type to use
141 --logtype Specifies the type of logfiles to parse
142 --select Select statements. See README.selections
144 You can prepend two dashes to every keyword in the config file and
145 configure yaala from the command line.
152 print STDERR $/ if ($DEBUG);