You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

js-logger

Package Overview
Dependencies
Maintainers
2
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-logger - npm Package Compare versions

Comparing version

to
0.9.6

5

CHANGELOG.md

@@ -0,1 +1,6 @@

## 0.9.6 (20th May, 2014)
Bugfixes:
- `Logger.useDefaults()` now supports IE8+ (#4, @AdrianTP)
## 0.9.5 (19th May, 2014)

@@ -2,0 +7,0 @@

2

package.json
{
"name": "js-logger",
"version": "0.9.5",
"version": "0.9.6",
"description": "Lightweight, unobtrusive, configurable JavaScript logger",

@@ -5,0 +5,0 @@ "author": "Jonny Reeves (http://jonnyreeves.co.uk)",

@@ -48,3 +48,3 @@ /*!

};
// Predefined logging levels.

@@ -64,3 +64,3 @@ Logger.DEBUG = defineLogLevel(1, 'DEBUG');

};
ContextualLogger.prototype = {

@@ -80,3 +80,3 @@ // Changes the current logging level for the logging instance.

},
debug: function () {

@@ -89,3 +89,3 @@ this.invoke(Logger.DEBUG, arguments);

},
warn: function () {

@@ -98,3 +98,3 @@ this.invoke(Logger.WARN, arguments);

},
// Invokes the logger callback if it's not being filtered.

@@ -106,12 +106,12 @@ invoke: function (level, msgArgs) {

}
};
};
// Protected instance which all calls to the to level `Logger` module will be routed through.
var globalLogger = new ContextualLogger({ filterLevel: Logger.OFF });
// Configure the global Logger instance.
(function() {
(function() {
// Shortcut for optimisers.
var L = Logger;
L.enabledFor = bind(globalLogger, globalLogger.enabledFor);

@@ -122,3 +122,3 @@ L.debug = bind(globalLogger, globalLogger.debug);

L.error = bind(globalLogger, globalLogger.error);
// Don't forget the convenience alias!

@@ -140,3 +140,3 @@ L.log = L.info;

globalLogger.setLevel(level);
// Apply this level to all registered contextual loggers.

@@ -154,6 +154,6 @@ for (var key in contextualLoggersByNameMap) {

// All logger instances are cached so they can be configured ahead of use.
return contextualLoggersByNameMap[name] ||
return contextualLoggersByNameMap[name] ||
(contextualLoggersByNameMap[name] = new ContextualLogger(merge({ name: name }, globalLogger.context)));
};
};
// Configure and example a Default implementation which writes to the `window.console` (if present).

@@ -163,3 +163,2 @@ Logger.useDefaults = function(defaultLevel) {

if (!console) {
console.log("no console");
return;

@@ -176,3 +175,3 @@ }

}
// Delegate through to custom warn/error loggers if present on the console.

@@ -187,3 +186,4 @@ if (context.level === Logger.WARN && console.warn) {

hdlr.apply(console, messages);
// Support for IE8+ (and other, slightly more sane environments)
Function.prototype.apply.call(hdlr, console, messages);
});

@@ -190,0 +190,0 @@ };