Skip Menu |

This queue is for tickets about the Log-Any-Adapter CPAN distribution.

Maintainer(s)' notes

DO NOT FILE TICKETS HERE

This distribution has been merged with Log-Any. Instead, file tickets on Github here → Log Any Issues.

Report information
The Basics
Id: 89917
Status: resolved
Priority: 0/
Queue: Log-Any-Adapter

People
Owner: Nobody in particular
Requestors: GVL [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 0.11
Fixed in: (no value)



Subject: only logs the first element of an array
At least with Log::Any::Adapter::Stdout, if you pass an array to $log->level() it will only log the first element of the array. This is important if one has the habbit of doing things like $log->debug(Dumper($a, $b, $c)).
On Thu Oct 31 04:31:09 2013, GVL wrote: Show quoted text
> At least with Log::Any::Adapter::Stdout, if you pass an array to $log-
> >level() it will only log the first element of the array. This is
> important if one has the habbit of doing things like $log-
> >debug(Dumper($a, $b, $c)).
The logging functions expect only a single argument. (That could probably be clearer in the documentation.) Maybe your habit should become $log->debug($_) for Dumper($a, $b, $c). I'll keep this ticket open as a reminder to fix the docs. Thank you.
Most loggers take arrays as arguments. The difference is mainly in how they join the elements of the array. For instance Log::Handler joins them with space, while Log::Log4perl concatenates the strings just like print @array does. You would then have the option of inserting timestamp/level/facility/caller, etc. in one go. I guess one of my options is writing an adapter that does this, then.
On Thu Oct 31 13:54:21 2013, GVL wrote: Show quoted text
> Most loggers take arrays as arguments. The difference is mainly in how > they join the elements of the array. For instance Log::Handler joins > them with space, while Log::Log4perl concatenates the strings just > like print @array does. You would then have the option of inserting > timestamp/level/facility/caller, etc. in one go. > > I guess one of my options is writing an adapter that does this, then.
Taking a single string is least common denominator for something like Log::Any. However, I'm in the middle of a substantial revision to Log::Any that will make it easy to add your own formatting code, so if you want to take arrays and join them somehow, you can do that trivially without needing to mess with an Adapter class. I need to write some docs and test it before I ship it, but you can see the work in progress here: https://github.com/dagolden/Log-Any