Comparing version 0.2.0 to 0.2.1
11
log.js
// Generated by CoffeeScript 1.6.3 | ||
(function() { | ||
var log, util, write, | ||
var debugEnabled, log, util, write, | ||
__slice = [].slice; | ||
@@ -8,2 +8,7 @@ | ||
debugEnabled = function() { | ||
var _ref; | ||
return (typeof window !== "undefined" && window !== null ? window.debug : void 0) || ((_ref = process.env.DEBUG) != null ? _ref.toLowerCase() : void 0) !== "false"; | ||
}; | ||
write = function(level, message, formatParams) { | ||
@@ -48,3 +53,3 @@ if (process.env.DISABLE_LOGGING) { | ||
message = arguments[0], others = 2 <= arguments.length ? __slice.call(arguments, 1) : []; | ||
if (process.env.DEBUG || (typeof window !== "undefined" && window !== null ? window.debug : void 0)) { | ||
if (debugEnabled()) { | ||
return write("DEBUG", message, others); | ||
@@ -56,3 +61,3 @@ } | ||
message = arguments[0], others = 2 <= arguments.length ? __slice.call(arguments, 1) : []; | ||
if (process.env.DEBUG || (typeof window !== "undefined" && window !== null ? window.debug : void 0)) { | ||
if (debugEnabled()) { | ||
return write("EVENT", message, others); | ||
@@ -59,0 +64,0 @@ } |
{ | ||
"name": "simplog", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "A very simple logging module. Because all the others are too much.\n This module relies on the node util module to provide timestamping and formatting of log messages.\n Messages are written to stdout via util.log.", | ||
@@ -5,0 +5,0 @@ "main": "log.js", |
@@ -41,1 +41,3 @@ # simplog | ||
you can make `process.env.NOLOGPID` truthy and it will go away. If there's something called window in the global scope, we'll skip the PID in any output. Reasonable? | ||
If, for any reason, you want to avoid any log output you can make `DISABLE_LOGGING` ( an environment variable ) truthy and all logging will be skipped. I find this helpful for testing things that use simplog. |
Sorry, the diff of this file is not supported yet
8154
27
61
43
4