Comparing version 1.0.0-b6 to 1.0.0
@@ -40,2 +40,4 @@ /* This Source Code Form is subject to the terms of the Mozilla Public | ||
var ORIGINAL_STDERR; | ||
function endsWith(str, suffix) { | ||
@@ -137,2 +139,3 @@ return str.indexOf(suffix, str.length - suffix.length) !== -1; | ||
'(.+)', // message | ||
'\n?', // debug 2.0 addes a newline | ||
'$' | ||
@@ -231,3 +234,7 @@ ].join('')); | ||
if (name.indexOf(ignore[i]) === 0) { | ||
ORIGINAL_METHODS[method].apply(console, args); | ||
if (method === 'stderr') { | ||
ORIGINAL_STDERR.call(process.stderr, args[0]); | ||
} else { | ||
ORIGINAL_METHODS[method].apply(console, args); | ||
} | ||
return; | ||
@@ -260,2 +267,6 @@ } | ||
if (!ORIGINAL_STDERR) { | ||
ORIGINAL_STDERR = process.stderr.write; | ||
} | ||
ALIASES.forEach(function(method) { | ||
@@ -274,2 +285,7 @@ console[method] = function alias(){ | ||
}; | ||
process.stderr.write = function write(str) { | ||
deliver('stderr', [str]); | ||
return true; | ||
}; | ||
} | ||
@@ -285,2 +301,6 @@ | ||
dbug.__log = __log; | ||
if (ORIGINAL_STDERR) { | ||
process.stderr.write = ORIGINAL_STDERR; | ||
ORIGINAL_STDERR = undefined; | ||
} | ||
} | ||
@@ -287,0 +307,0 @@ |
@@ -0,0 +0,0 @@ /* This Source Code Form is subject to the terms of the Mozilla Public |
@@ -0,0 +0,0 @@ /* This Source Code Form is subject to the terms of the Mozilla Public |
@@ -0,0 +0,0 @@ /* This Source Code Form is subject to the terms of the Mozilla Public |
@@ -0,0 +0,0 @@ /* This Source Code Form is subject to the terms of the Mozilla Public |
@@ -0,0 +0,0 @@ /* This Source Code Form is subject to the terms of the Mozilla Public |
@@ -5,4 +5,2 @@ /* This Source Code Form is subject to the terms of the Mozilla Public | ||
const deprecate = require('depd')('intel'); | ||
const Formatter = require('../formatter'); | ||
@@ -16,3 +14,3 @@ const Filterer = require('../filterer'); | ||
function emit(record) { | ||
return this._emit(record, this.__deprecatedCallback); | ||
return this._emit(record); | ||
} | ||
@@ -22,3 +20,3 @@ | ||
if (this.filter(record)) { | ||
this.__emit(record, this.__deprecatedCallback); | ||
this.__emit(record); | ||
} | ||
@@ -34,11 +32,4 @@ } | ||
this.setFormatter(options.formatter || _defaultFormatter); | ||
if ('timeout' in options) { | ||
this._timeout = options.timeout; | ||
} | ||
this.handle = this.__emit; | ||
Filterer.call(this, options); | ||
this.__deprecatedCallback = function deprecated() { | ||
deprecate('Handler.emit callback argument has been removed'); | ||
}; | ||
} | ||
@@ -88,6 +79,2 @@ | ||
} | ||
if (val.length === 2) { | ||
deprecate('Handler.emit callback argument has been removed'); | ||
} | ||
this._emit = val; | ||
@@ -97,9 +84,2 @@ } | ||
Object.defineProperty(Handler.prototype, '_timeout', { | ||
set: function() { | ||
deprecate('Handler.timeout option has been removed'); | ||
} | ||
}); | ||
module.exports = Handler; |
@@ -0,0 +0,0 @@ /* This Source Code Form is subject to the terms of the Mozilla Public |
@@ -0,0 +0,0 @@ /* This Source Code Form is subject to the terms of the Mozilla Public |
@@ -0,0 +0,0 @@ /* This Source Code Form is subject to the terms of the Mozilla Public |
@@ -0,0 +0,0 @@ /* This Source Code Form is subject to the terms of the Mozilla Public |
@@ -202,6 +202,8 @@ /* This Source Code Form is subject to the terms of the Mozilla Public | ||
logger._process.exit(1); | ||
}, 5000); | ||
}, this._exitTimeout); | ||
t.unref(); | ||
}, | ||
_exitTimeout: 5000, | ||
makeRecord: function makeRecord(name, level, msg, args) { | ||
@@ -208,0 +210,0 @@ return new Record(name, level, msg, args); |
@@ -8,3 +8,3 @@ /* This Source Code Form is subject to the terms of the Mozilla Public | ||
const stacktrace = require('stack-trace'); | ||
const Symbol = require('symbol'); | ||
const _Symbol = require('symbol'); | ||
@@ -14,3 +14,3 @@ const LEVELS = require('./levels'); | ||
const UNCAUGHT_SYMBOL = Symbol(); | ||
const UNCAUGHT_SYMBOL = _Symbol(); | ||
const LOG_VERSION = 1; // increment when log format changes | ||
@@ -17,0 +17,0 @@ const HOSTNAME = require('os').hostname(); |
@@ -0,0 +0,0 @@ /* This Source Code Form is subject to the terms of the Mozilla Public |
@@ -0,0 +0,0 @@ /* This Source Code Form is subject to the terms of the Mozilla Public |
@@ -0,0 +0,0 @@ /* This Source Code Form is subject to the terms of the Mozilla Public |
@@ -0,0 +0,0 @@ /* This Source Code Form is subject to the terms of the Mozilla Public |
{ | ||
"name": "intel", | ||
"version": "1.0.0-b6", | ||
"version": "1.0.0", | ||
"dependencies": { | ||
"chalk": "~0.5.1", | ||
"dbug": "~0.4.1", | ||
"depd": "~1.0.0", | ||
"dbug": "~0.4.2", | ||
"stack-trace": "~0.0.9", | ||
"strftime": "~0.8.0", | ||
"strftime": "~0.8.2", | ||
"symbol": "~0.2.0", | ||
@@ -16,7 +15,7 @@ "utcstring": "~0.1.0" | ||
"bluebird": "~2.3.2", | ||
"debug": "~2.0.0", | ||
"debug": "~2.1.0", | ||
"insist": "0.x", | ||
"jshint": "2.x", | ||
"matcha": "0.x", | ||
"mocha": "1.x", | ||
"mocha": "2.x", | ||
"mocha-text-cov": "~0.1.0", | ||
@@ -23,0 +22,0 @@ "walk": "2.x", |
@@ -16,2 +16,3 @@ # intel | ||
- console injection works with all libraries | ||
- fast where possible | ||
@@ -31,3 +32,2 @@ ## Table of Contents | ||
- [FileHandler](#filehandler) | ||
- [RotatingFileHandler](#rotatingfilehandler) | ||
- [NullHandler](#nullhandler) | ||
@@ -194,15 +194,2 @@ - [Creating a Custom Handler](#creating-a-custom-handler) | ||
### RotatingFileHandler | ||
```js | ||
new intel.handlers.Rotating(options); | ||
``` | ||
The Rotating handler extends the [File](#filehandler) handler, making sure log files don't go over a specified size. | ||
- **maxSize** - A number of bytes to restrict the size of log files. | ||
- **maxFiles** - A number of log files to create after the size restriction is met. | ||
As files reach the max size, the files will get moved to a the same name, with a number attached to the end. So, `intel.log` will become `intel.log.1`, and `intel.log.1` would move to `intel.log.2`, up to the maxFiles number. | ||
### NullHandler | ||
@@ -231,3 +218,3 @@ | ||
CustomHandler.prototype.emit = function customEmit(record, callback) { | ||
CustomHandler.prototype.emit = function customEmit(record) { | ||
// do whatever you need to with the log record | ||
@@ -237,5 +224,2 @@ // this could be storing it in a db, or sending an email, or sending an HTTP request... | ||
// str = this.format(record); | ||
// The callback should be called indicating whether there was an error or not. | ||
callback(err); | ||
} | ||
@@ -242,0 +226,0 @@ ``` |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
77094
6
1343
0
446
- Removeddepd@~1.0.0
- Removeddepd@1.0.1(transitive)
Updateddbug@~0.4.2
Updatedstrftime@~0.8.2