[Dancer-users] Dancer2 - feature change request

Brian E. Lozier brian at massassi.com
Fri Oct 21 19:21:34 CEST 2011


On Fri, Oct 21, 2011 at 10:09 AM, Flavio Poletti <polettix at gmail.com> wrote:

> On Fri, Oct 21, 2011 at 11:55 AM, Richard Huxton <dev at archonet.com> wrote:
>
>> At the moment, the logging levels are exposed directly (debug, warning,
>> error). All the major logging modules seem to expose a single object
>> (Log::Log4perl, Log::Dispatch, Log::Any etc). Doing similar would make
>> logging more consistent across dancer and my non-web modules.
>>
>> To be explicit, I'm suggesting this:
>>  debug("current id = $id")
>> would become:
>>  log->debug("current id = $id")
>>
>> It's a purely cosmetic change at one level, but it does:
>> 1. Reduce namespace pollution
>> 2. Allow for alternative log-levels
>>
>
> Namespace pollution is - for good or bad - what Dancer is about; otherwise,
> there would be no DSL. I like the idea of having one-off functions for
> logging as for anything else, even if I like Log::Log4perl and I usually
> avoid Dancer's internal debugging. IMHO your proposal should go on the
> Plugin side (e.g. Dancer::Plugin::Log::Log4perl)
>

Everyone keeps talking about "DSL" -- what is that?  Last time I used DSL it
was for getting internet access through the phone company.  (and don't use
google to search for "define dsl" at work, you don't want to see the urban
dictionary result)



>
>
>
>> I actually think the printf-style functionality of Log::Any is worth
>> stealing too. It lets you do things like:
>>  log->debugf("user %d has fields %s", $user_id, $user_hashref)
>> With $user_hashref being automatically piped through Data::Dumper
>
>
> I like the idea of the "-f", but this would probably bloat and pollute the
> namespace. Again... this would be a nice plugin :-)
>
> _______________________________________________
> Dancer-users mailing list
> Dancer-users at perldancer.org
> http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.backup-manager.org/pipermail/dancer-users/attachments/20111021/4d145d94/attachment.htm>


More information about the Dancer-users mailing list