[interchange-cvs] [SCM] Interchange branch, master, updated. REL_5_7_3-13-gcf9632f

Jon Jensen interchange-cvs at icdevgroup.org
Sat Nov 14 02:29:54 UTC 2009


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Interchange".

The branch, master has been updated
       via  cf9632fad3cc89f9790e6c920094cc19a1e76da3 (commit)
       via  8ab173df288c29eff0521835dc824e81e34d4478 (commit)
      from  aa66f45a8ea472baaf77350cf3001753d4fab65b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit cf9632fad3cc89f9790e6c920094cc19a1e76da3
Author: Jon Jensen <jon at endpoint.com>
Date:   Fri Nov 13 19:02:03 2009 -0700

    Work around freakish problem with eval + Sys::Syslog

commit 8ab173df288c29eff0521835dc824e81e34d4478
Author: Jon Jensen <jon at endpoint.com>
Date:   Fri Nov 13 18:40:46 2009 -0700

    Correct log level mapping and bare log level handling (contra facility.level)

-----------------------------------------------------------------------

Summary of changes and diff:
 lib/Vend/Util.pm |   40 ++++++++++++++++++++--------------------
 1 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/lib/Vend/Util.pm b/lib/Vend/Util.pm
index ae64fdd..3c79f13 100644
--- a/lib/Vend/Util.pm
+++ b/lib/Vend/Util.pm
@@ -1740,17 +1740,17 @@ sub logGlobal {
 
 	my ($fn, $facility, $level);
 	if ($Global::SysLog) {
-		my $level_opt = $opt->{level};
+		$facility = 'local3';
+		$level    = $opt->{level} || 'info';
 		my $level_mapped;
-		if (
-			$level_opt
-			and $level_mapped = $Global::SysLog->{$level_opt}
-			and $level_mapped =~ /(.+)\.(.+)/
-		) {
-			($facility, $level) = ($1, $2);
+		if ($level_mapped = $Global::SysLog->{$level}) {
+			if ($level_mapped =~ /(.+)\.(.+)/) {
+				($facility, $level) = ($1, $2);
+			}
+			else {
+				$level = $level_mapped;
+			}
 		}
-		$facility ||= 'local3';
-		$level    ||= 'info';
 
 		my $tag = $Global::SysLog->{tag} || 'interchange';
 
@@ -1807,19 +1807,19 @@ sub logGlobal {
 			}
 			close(MVERROR) or die "close\n";
 		};
+		if ($@) {
+			chomp $@;
+			print "\nCould not $@ error file '$Global::ErrorFile':\n$!\n";
+			print "to report this error:\n", $msg, "\n";
+			exit 1;
+		}
+
 	}
 	elsif ($Vend::SysLogReady) {
-		eval {
-			Sys::Syslog::syslog "$level|$facility", $msg;
-		};
-	}
-
-	if ($@) {
-		chomp $@;
-		print "\nCould not $@ error file '";
-		print $Global::ErrorFile, "':\n$!\n";
-		print "to report this error:\n", $msg, "\n";
-		exit 1;
+		# Do not call this from within an eval, because in some strange circumstances
+		# it will cause the eval inside &Sys::Syslog::xlate to fail, which then croaks.
+		# The cause of this freakish problem is still to be determined.
+		Sys::Syslog::syslog "$level|$facility", $msg;
 	}
 
 	return 1;


hooks/post-receive
-- 
Interchange



More information about the interchange-cvs mailing list