logger.pm (2f2de527) | logger.pm (9f91b7e3) |
---|---|
1#************************************************************** 2# 3# Licensed to the Apache Software Foundation (ASF) under one 4# or more contributor license agreements. See the NOTICE file 5# distributed with this work for additional information 6# regarding copyright ownership. The ASF licenses this file 7# to you under the Apache License, Version 2.0 (the 8# "License"); you may not use this file except in compliance --- 79 unchanged lines hidden (view full) --- 88 'is_show_process_id' => 0, 89 'is_show_log_id' => 0 90 ); 91 92 93 94=head2 SetupSimpleLogging ($filename) 95 | 1#************************************************************** 2# 3# Licensed to the Apache Software Foundation (ASF) under one 4# or more contributor license agreements. See the NOTICE file 5# distributed with this work for additional information 6# regarding copyright ownership. The ASF licenses this file 7# to you under the Apache License, Version 2.0 (the 8# "License"); you may not use this file except in compliance --- 79 unchanged lines hidden (view full) --- 88 'is_show_process_id' => 0, 89 'is_show_log_id' => 0 90 ); 91 92 93 94=head2 SetupSimpleLogging ($filename) 95 |
96 Setup logging so that $Global, $Lang and $Info all print to the console AND to the log file. | 96 Setup logging so that $Global, $Lang and $Info all print to the console. 97 If $filename is given then logging also goes to that file. |
97 98=cut | 98 99=cut |
99sub SetupSimpleLogging ($) | 100sub SetupSimpleLogging (;$) |
100{ 101 my ($log_filename) = @_; 102 103 $Info = installer::logger->new("info", 104 'is_print_to_console' => 1, 105 'is_show_relative_time' => 1, 106 ); 107 $Global = installer::logger->new("glob", 108 'is_print_to_console' => 0, 109 'is_show_relative_time' => 1, 110 'forward' => [$Info] 111 ); 112 $Lang = installer::logger->new("lang", 113 'is_print_to_console' => 0, 114 'is_show_relative_time' => 1, 115 'forward' => [$Info] 116 ); | 101{ 102 my ($log_filename) = @_; 103 104 $Info = installer::logger->new("info", 105 'is_print_to_console' => 1, 106 'is_show_relative_time' => 1, 107 ); 108 $Global = installer::logger->new("glob", 109 'is_print_to_console' => 0, 110 'is_show_relative_time' => 1, 111 'forward' => [$Info] 112 ); 113 $Lang = installer::logger->new("lang", 114 'is_print_to_console' => 0, 115 'is_show_relative_time' => 1, 116 'forward' => [$Info] 117 ); |
117 $Info->set_filename($log_filename); | 118 if (defined $log_filename) 119 { 120 $Info->set_filename($log_filename); 121 } |
118 $Info->{'is_print_to_console'} = 1; 119 $installer::globals::quiet = 0; 120 starttime(); 121} 122 123 124 125 --- 618 unchanged lines hidden --- | 122 $Info->{'is_print_to_console'} = 1; 123 $installer::globals::quiet = 0; 124 starttime(); 125} 126 127 128 129 --- 618 unchanged lines hidden --- |