conlog
Simple colorful logger for node.js console
Using
var __c = 'test'; "Info only message";"Debug information";"Warning message";"RED ERROR!";"Simple log";"Indented text"; __c;__cname'update'; __c;"Run %s";"Test with %s arguments from %s %s"; ""; __c;"Start log in %s environment";"%s listening on %s port";
Result:
06 May 01:44:37 [test] Info only message
debug [test] Debug information
06 May 01:44:37 [test] Warning! Warning message
06 May 01:44:37 [test] RED ERROR!
06 May 01:44:37 [test] Simple log
[test] Indented text
06 May 01:44:37 [update] Run Forrest
debug [update] Test with many arguments from log function
06 May 01:44:37 [update] Start log in debug environment
06 May 01:44:37 [update] Express listening on 1240 port
You can use attributes from Colors:
"Using:";"help"green;"exit"green;"quit"green;
And you can use %s
template:
"Start log in %s environment";"%s listening on %s port";
Shows n empty lines:
var __c = 'appname'; // three empty lines__c;// equal with""; // or any string // shows one empty string""; // or __c.empty();
Options
You can change the app name if you want:
var __c = 'appname'; __cname'newappname';
You can disable and enable color output:
var enablecolors = true;var __c = 'appname' enablecolors; "Hello %s"; __c; "Specify log info";"Warning";"Error"; __c; "Colorful text";