Comparing version 0.1.5 to 0.1.6
17
main.js
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.8.0 | ||
// Generated by CoffeeScript 1.9.0 | ||
var Logger, colors, dateFormat, levelColors; | ||
@@ -27,4 +27,4 @@ | ||
Logger = (function() { | ||
function Logger(options) { | ||
this.options = options; | ||
function Logger(_at_options) { | ||
this.options = _at_options; | ||
if (this.options == null) { | ||
@@ -43,3 +43,3 @@ this.options = {}; | ||
Logger.prototype.format = function(level, text) { | ||
var date, padding; | ||
var date; | ||
if (text instanceof Object) { | ||
@@ -49,9 +49,4 @@ text = JSON.stringify(text); | ||
if (this.options.prefix != null) { | ||
text = "" + this.options.prefix + " | " + text; | ||
text = this.options.prefix + " | " + text; | ||
} | ||
if (level === 'info' || level === 'warn') { | ||
padding = ' '; | ||
} else { | ||
padding = ''; | ||
} | ||
if (process.env.NODE_ENV !== 'production') { | ||
@@ -61,3 +56,3 @@ level = this.colorify(level, levelColors[level]); | ||
if (level) { | ||
text = "" + level + padding + " - " + text; | ||
text = level + " - " + text; | ||
} | ||
@@ -64,0 +59,0 @@ if (this.options.date) { |
@@ -16,3 +16,3 @@ { | ||
], | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"homepage": "https://github.com/frankrousseau/printit/", | ||
@@ -19,0 +19,0 @@ "bugs": { |
@@ -10,2 +10,14 @@ ## It began with a console.log... | ||
### Display rules | ||
The way printit displays things is changed via environment variable: | ||
* Debug messages are not displayed. | ||
* When NODE_ENV is 'production', it doesn't display colors (it's better when you cat/tail a log file). | ||
* When NODE_ENV is 'test', it doesn't display logs (logs make mocha output | ||
looks less messy). | ||
* When DEBUG is 'true', it displays the debug messages. | ||
### Examples | ||
```javascript | ||
@@ -12,0 +24,0 @@ var printit = require('printit'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19638
44
427