Logginz ur console with Mojolicious
A new Mojolicious plugin has been released, Mojolicious::Plugin::ConsoleLogger.
By default, Mojolicious will send debug messages to a log/[mode].log file; if the log directory does not exist, messages will default to the terminal console.
You can use any of the four logging groups for customized messages:
With Mojolicious::Plugin::ConsoleLogger, you can log these same messages directly to your browser console.
Declare the plugin:
And view all your log messages directly from your browser:
That's all well and good, but let's take it a step further. You can even see error messages when the template is missing:
Or when there's a template error:
Even when there's a Perl compilation error:
As always, Mojolicious installs in about a minute:
sudo -s 'curl -L cpanmin.us | perl - Mojolicious::Plugin::ConsoleLogger'
Disclaimer:
Implementation stolen from Plack::Middleware::ConsoleLogger
Leave a comment