Re: [log4perl-devel] log4perl Data::Dumper and renaming $VAR1

2010-04-09 Thread Josh803316
Thanks, that worked like a charm!  Just for my own edificationwhat is
the real difference between the filter method and the sub method or are they
basically the same?

On Fri, Apr 9, 2010 at 1:20 AM, Mike Schilli  wrote:

> On Fri, 9 Apr 2010, Josh803316 wrote:
>
>  $logger->trace( {filter => \&Data::Dumper::Dumper, value => $name},
>> undef, $TRACE, undef, undef); So my question is, how can I log the
>> value so it looks like $name instead of $VAR1 in the saved log?
>>
>
> You can pass a reference to a subroutine to Log4perl's logging methods:
>
> $logger->trace( sub { Data::Dumper->Dump([$name], ['name']) } );
>
> would do the trick while retaining the time-saving late evaluation.
>
> -- Mike
>
> Mike Schilli
> [email protected]
>
--
Download IntelĀ® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
log4perl-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/log4perl-devel


Re: [log4perl-devel] log4perl Data::Dumper and renaming $VAR1

2010-04-09 Thread Mike Schilli
On Fri, 9 Apr 2010, Josh803316 wrote:

> wn edificationwhat is the real difference between the filter
> method and the sub method or are they basically the same?

They're the same, just different notations.

-- Mike

Mike Schilli
[email protected]

--
Download IntelĀ® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
log4perl-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/log4perl-devel