One (final?) step towards easy universal plugins (working with both versions of dancer) would be an universal way of logging.
One problem with Dancer 2 logging is the use of log keyword, as I already pointed sometimes.
Matt Trout defends the use of Log::Contextual and it seems that some other are tempted as well (@xsawyerx at least, if I am not mistaken).
The few I could learn for some minutes looking to Log::Contextual, it works with log_$level and a subroutine reference. With that in mind, I wrote five methods in Dancer::Plugin to solve that.
If you all think this might work, I'll merge this, and work on integrating Log::Contextual on Dancer 2.
Feedback is welcome (@sukria, @dams, @bigpresh, @franckcuny, Matt...)
Add log_ compat methods
It is not that difficult, so, give a little more compatibility with
How would Log::Contextual look like in Dancer 2?
I would expect to, at least, make 5 similar methods like these available in Dancer 2. But, not sure. Some brainstorming is always welcome.
This seems sane to me, and has been waiting for some time - anyone object to it being merged?
No longer relevant. Long live Dancer2.