Commit bf3a9a14 authored by Marcel Rieger's avatar Marcel Rieger
Browse files

Update logger plugin.

parent 35d42b75
/*!
* jQuery Logging Plugin v0.4.2
* jQuery Logging Plugin v0.4.3
* https://github.com/riga/jquery.logger
*
* Copyright 2015, Marcel Rieger
......@@ -24,7 +24,7 @@
// name of the global namespace
global: "global",
// delimitter that seperates namespaces
// delimitter that separates namespaces
delimitter: ".",
// use appropriate console logging methods instead of the standard log method,
......@@ -502,9 +502,22 @@
*/
$.each(levels, function(level) {
self[level] = function() {
var fn = self[level] = function() {
return self._log.call(self, level, arguments);
};
// create a custom "bind" function that does the same as the original one
// but also updates the origin offset
fn._bind = fn.bind;
fn.bind = function(thisArg) {
var args = Array.prototype.slice.call(arguments, 1);
return function() {
args.push.apply(args, Array.prototype.slice.call(arguments));
self.originOffset(1);
fn.apply(thisArg, args);
};
};
});
......@@ -543,6 +556,10 @@
}
/**
* Return the created shortcuts.
*/
return self;
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment