Hey Mike, thanks again for your help. Would it make sense to have another interface that allows one to specify the exit value ? Doing the following e.g.
$Log::Log4perl::LOGEXIT_CODE = 113; $logger->logdie( "my message" ); Is still two lines of code instead of one. I was hoping for the possibility that a function like: $logger->logdie ( "my message", 113 ); existed, or could be added in log4perl. I mean, I don't see how what is suggested for suppressing duplicate logdie messages is any different, or more efficient, than: $logger->error( "my message" ) && exit 113; In particular, I'm trying to "format" messages before I emit them through the logger. This requires me to always call something like: $logger->error ( my_special_function_that_formats_the_message ( $error_value, "my message") ); and I'm trying to avoid calling $logger->error ( my_special_function_that_formats_the_message ( $error_value, "my message") ) && exit $error_value; This all looks and feel dirty. I'm essentially constructing parts of the ConversionPattern (perhaps there's a better way to do this). Would it be a good idea for log4perl to provide a way for both allowing multiple arguments supplied to the ConversionPattern, and also supplying an (optional) error code ? It is natural that error log messages also contain an error value. I'd like to construct the message in the ConversionPattern to include the error code, and also exit with that error code. On Wed, 2008-06-04 at 23:40 -0700, Mike Schilli wrote: > On Tue, 3 Jun 2008, Kristis Makris wrote: > > > How can I do that ? I've tried logdie, logwarn, error_warn, logcroak, > > logconfess without success. I either get duplicate error messages > > printed, not dying, or a combination of the two. > > If you want the error message only once, check the section "Suppressing > 'duplicate' LOGDIE messages": > > http://log4perl.sourceforge.net/d/Log/Log4perl.html#a722d > > -- Mike > > Mike Schilli > [EMAIL PROTECTED]
signature.asc
Description: This is a digitally signed message part
------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php
_______________________________________________ log4perl-devel mailing list log4perl-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/log4perl-devel