[interchange-cvs] interchange - heins modified lib/Vend/Util.pm
interchange-cvs at icdevgroup.org
interchange-cvs at icdevgroup.org
Fri Jan 7 16:26:08 EST 2005
User: heins
Date: 2005-01-07 21:26:08 GMT
Modified: lib/Vend Util.pm
Log:
* Add ability to route certain error messages with either a $opt->{tag}
option call or by the string that the errmsg() routine is called
with.
Adds ErrorDestination directive. Example:
ErrorDestination "Attempt to order missing product code: %s" logs/missing_product.log
Revision Changes Path
2.76 +9 -2 interchange/lib/Vend/Util.pm
rev 2.76, prev_rev 2.75
Index: Util.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Util.pm,v
retrieving revision 2.75
retrieving revision 2.76
diff -u -r2.75 -r2.76
--- Util.pm 15 Jul 2004 17:29:23 -0000 2.75
+++ Util.pm 7 Jan 2005 21:26:07 -0000 2.76
@@ -1,6 +1,6 @@
# Vend::Util - Interchange utility functions
#
-# $Id: Util.pm,v 2.75 2004/07/15 17:29:23 mheins Exp $
+# $Id: Util.pm,v 2.76 2005/01/07 21:26:07 mheins Exp $
#
# Copyright (C) 2002-2003 Interchange Development Group
# Copyright (C) 1996-2002 Red Hat, Inc.
@@ -87,7 +87,7 @@
use Vend::File;
use subs qw(logError logGlobal);
use vars qw($VERSION @EXPORT @EXPORT_OK);
-$VERSION = substr(q$Revision: 2.75 $, 10);
+$VERSION = substr(q$Revision: 2.76 $, 10);
my $Eval_routine;
my $Eval_routine_file;
@@ -1692,6 +1692,13 @@
else {
$opt = {};
}
+
+ if(! $opt->{file}) {
+ my $tag = $opt->{tag} || $msg;
+ if(my $dest = $Vend::Cfg->{ErrorDestination}{$tag}) {
+ $opt->{file} = $dest;
+ }
+ }
$opt->{file} ||= $Vend::Cfg->{ErrorFile};
More information about the interchange-cvs
mailing list