[interchange-cvs] [SCM] Interchange branch, master, updated. REL_5_7_3-15-g7e3244d

Jon Jensen interchange-cvs at icdevgroup.org
Sat Nov 14 04:47:13 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  7e3244de90b9b137287f74afbfbbab80cc611265 (commit)
       via  e65bddc30adb290ea943398089c8b76239b7046e (commit)
      from  cf9632fad3cc89f9790e6c920094cc19a1e76da3 (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 7e3244de90b9b137287f74afbfbbab80cc611265
Author: Jon Jensen <jon at endpoint.com>
Date:   Fri Nov 13 21:07:14 2009 -0700

    Add new facility option to SysLog global directive
    
    This allows redirecting all syslog output to a new facility without
    manually having to specify the target of each level. For example,
    to send to facility local5 instead of the default local3:
    
    SysLog  facility  local5

commit e65bddc30adb290ea943398089c8b76239b7046e
Author: Jon Jensen <jon at endpoint.com>
Date:   Fri Nov 13 20:54:17 2009 -0700

    Remap deprecated syslog levels to modern equivalents
    
    The logger(1) command supported 3 deprecated syslog levels that syslog(3)
    does not. Map these internally to avoid syslog generating an error itself.

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

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

diff --git a/lib/Vend/Util.pm b/lib/Vend/Util.pm
index 3c79f13..e3f270d 100644
--- a/lib/Vend/Util.pm
+++ b/lib/Vend/Util.pm
@@ -1740,17 +1740,27 @@ sub logGlobal {
 
 	my ($fn, $facility, $level);
 	if ($Global::SysLog) {
-		$facility = 'local3';
+		$facility = $Global::SysLog->{facility} || 'local3';
 		$level    = $opt->{level} || 'info';
-		my $level_mapped;
-		if ($level_mapped = $Global::SysLog->{$level}) {
-			if ($level_mapped =~ /(.+)\.(.+)/) {
+
+		# remap deprecated synonyms supported by logger(1)
+		my %level_map = (
+			error => 'err',
+			panic => 'emerg',
+			warn  => 'warning',
+		);
+
+		# remap levels according to any user-defined global configuration
+		my $level_cfg;
+		if ($level_cfg = $Global::SysLog->{$level_map{$level} || $level}) {
+			if ($level_cfg =~ /(.+)\.(.+)/) {
 				($facility, $level) = ($1, $2);
 			}
 			else {
-				$level = $level_mapped;
+				$level = $level_cfg;
 			}
 		}
+		$level = $level_map{$level} if $level_map{$level};
 
 		my $tag = $Global::SysLog->{tag} || 'interchange';
 


hooks/post-receive
-- 
Interchange



More information about the interchange-cvs mailing list