Skip to Content.
Sympa Menu

devel - patch for newly introduced bugs

Subject: Developers of Sympa

List archive

Chronological Thread  
  • From: Sergiy Zhuk <address@concealed>
  • To: address@concealed
  • Subject: patch for newly introduced bugs
  • Date: Thu, 14 Feb 2002 19:25:52 -0800 (PST)

hi

There're several problems introduced with the new log_level feature in the
current sympa version (under CVS).

1. The $log_level was defined incorrectly, so no matter what you set it to in
different modules, it was always reset to 0.

2. a typo in task_manager.pl made it die because of incorrect debug level

4. sympa.pl were setting log_level in the main loop and logging the level
change every time if it was taking the value from $Conf
result - a lot of extra useless logging

3. cookies.hystory was and is actually cookies.history (check the spelling)

The attached patch fixes all the above.

thanks

--
rgds,
serge
--- sympa.pl.orig Thu Feb 14 16:08:56 2002
+++ sympa.pl Thu Feb 14 15:36:52 2002
@@ -320,7 +320,7 @@
# setting log_level using conf unless it is set by calling option
unless ($main::options{'log_level'}) {
$log_level = $Conf{'log_level'};
- do_log('notice', "Reset default log level $log_level");
+# do_log('notice', "Reset default log level $log_level");
}

--- task_manager.pl.orig Thu Feb 14 16:09:01 2002
+++ task_manager.pl Thu Feb 14 15:34:46 2002
@@ -233,7 +233,7 @@
my @tasks = sort epoch_sort (grep !/^\.\.?$/, readdir DIR);

## processing of tasks anterior to the current date
- &do_log ('debuug3', 'processing of tasks anterior to the current date');
+ &do_log ('debug3', 'processing of tasks anterior to the current date');
foreach my $task (@tasks) {
$task =~ /^(\d+)\.\w*\.\w+\.($regexp{'listname'}|_global)$/;
# &do_log ('debuug3', "procesing %s/%s", $spool_task,$task);


--- tools.pl.orig Thu Feb 14 16:14:56 2002
+++ tools.pl Thu Feb 14 15:39:34 2002
@@ -670,8 +670,8 @@
my $current=shift;
my $changed = 1 ;
if (-f "$Conf{'etc'}/cookies.history") {
- unless (open COOK, "$Conf{'etc'}/cookies.hystory") {
- do_log('err', "Unable to read $Conf{'etc'}/cookies.hystory") ;
+ unless (open COOK, "$Conf{'etc'}/cookies.history") {
+ do_log('err', "Unable to read $Conf{'etc'}/cookies.history") ;
return undef ;
}
my $oldcook = <COOK>;
@@ -696,7 +696,7 @@
return $changed ;
}else{
unless (open COOK, ">$Conf{'etc'}/cookies.history") {
- do_log('err', "Unable to create $Conf{'etc'}/cookies.hystory") ;
+ do_log('err', "Unable to create $Conf{'etc'}/cookies.history") ;
return undef ;
}
printf COOK "$current ";


--- Log.pm.orig Thu Feb 14 19:13:47 2002
+++ Log.pm Thu Feb 14 19:08:21 2002
@@ -30,7 +30,9 @@
@ISA = qw(Exporter);
@EXPORT = qw(fatal_err do_log do_openlog $log_level);

-my ($log_facility, $log_socket_type, $log_service, $log_level);
+local $log_level |= 0;
+
+my ($log_facility, $log_socket_type, $log_service);


sub fatal_err {
@@ -60,7 +62,7 @@
if ($fac =~ /debug(\d)/ ) {
$level = $1;
$fac = 'debug';
- }
+ }
# do not log if log level if too high regarding the log requested by
user
return if ($level > $log_level);
unless (syslog($fac, $m, @_)) {
@@ -93,9 +95,6 @@
}
openlog("$log_service\[$$\]", 'ndelay', $log_facility);
}
-
-
-$log_level |= 0;

1;




Archive powered by MHonArc 2.6.19+.

Top of Page