g4-logger
A simple logger that is configured with some niceties such as listening for a SIGUSR2 to change log levels
Log Levels
We use syslog levels RFC-5424 for the level definitions.
0
=Emergency
(panic) - Only logpanic
conditions1
=Alert
(alert) - Only notify on conditions that cause immediate failure from the local system.2
=Critical
(crit) - Notify on conditions that cause immediate failure from the local system or any secondary system or sub system.3
=Error
(error) - Failures that can be recovered from.4
=Warning
(warn) - Indicator that an error will occur if action is not taken.5
=Notice
(notice) - Normal but significant condition. May indicate a potential problem.6
=Informational
(info) - Normal operational messages.7
=Debug
(debug) - Information useful to developers for debugging the application.
Usage
Simply load the module and then call the appropriate message functions.
var Logger = logger = ; logger; logger; // should output [panic] - Everyone panic! logger; logger; // should output [crit] - A critical error. logger; // should output [error] - My terrible error logger; // should output [warn] - Beware of codes! logger; logger; // should output [notice] - A fancy notice logger; // Should output [info] - My super message logger; // Should output [debug] - My cool debug message