Skip to content

Commit

Permalink
fix(logger.logfn args fixes): specs added to ensure arguments get pas…
Browse files Browse the repository at this point in the history
…sed onto the logger function
  • Loading branch information
nmccready committed Jan 26, 2016
1 parent 0f17e02 commit 06fc827
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 94 deletions.
7 changes: 5 additions & 2 deletions dist/angular-simple-logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ angular.module('nemLogging').provider('nemDebug', function (){

return this;
});
var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
slice = [].slice;

angular.module('nemLogging').provider('nemSimpleLogger', [
'nemDebugProvider', function(nemDebugProvider) {
Expand Down Expand Up @@ -82,10 +83,12 @@ angular.module('nemLogging').provider('nemSimpleLogger', [
fn1 = (function(_this) {
return function(level) {
logFns[level] = function() {
var args;
args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
if (_this.doLog) {
return _maybeExecLevel(LEVELS[level], _this.currentLevel, function() {
var ref;
return (ref = _this.$log)[level].apply(ref, arguments);
return (ref = _this.$log)[level].apply(ref, args);
});
}
};
Expand Down
9 changes: 6 additions & 3 deletions dist/angular-simple-logger.light.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* @version: 0.1.6
* @author: Nicholas McCready
* @date: Tue Jan 26 2016 09:10:31 GMT-0500 (EST)
* @date: Tue Jan 26 2016 10:13:45 GMT-0500 (EST)
* @license: MIT
*/

Expand All @@ -23,7 +23,8 @@ angular.module('nemLogging').provider('nemDebug', function (){

return this;
});
var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
slice = [].slice;

angular.module('nemLogging').provider('nemSimpleLogger', [
'nemDebugProvider', function(nemDebugProvider) {
Expand Down Expand Up @@ -90,10 +91,12 @@ angular.module('nemLogging').provider('nemSimpleLogger', [
fn1 = (function(_this) {
return function(level) {
logFns[level] = function() {
var args;
args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
if (_this.doLog) {
return _maybeExecLevel(LEVELS[level], _this.currentLevel, function() {
var ref;
return (ref = _this.$log)[level].apply(ref, arguments);
return (ref = _this.$log)[level].apply(ref, args);
});
}
};
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-simple-logger.light.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/angular-simple-logger.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions dist/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ angular.module('nemLogging').provider('nemDebug', function (){

return this;
});
var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
slice = [].slice;

angular.module('nemLogging').provider('nemSimpleLogger', [
'nemDebugProvider', function(nemDebugProvider) {
Expand Down Expand Up @@ -82,10 +83,12 @@ angular.module('nemLogging').provider('nemSimpleLogger', [
fn1 = (function(_this) {
return function(level) {
logFns[level] = function() {
var args;
args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
if (_this.doLog) {
return _maybeExecLevel(LEVELS[level], _this.currentLevel, function() {
var ref;
return (ref = _this.$log)[level].apply(ref, arguments);
return (ref = _this.$log)[level].apply(ref, args);
});
}
};
Expand Down
9 changes: 6 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* @version: 0.1.6
* @author: Nicholas McCready
* @date: Tue Jan 26 2016 09:10:31 GMT-0500 (EST)
* @date: Tue Jan 26 2016 10:13:45 GMT-0500 (EST)
* @license: MIT
*/
var angular = require('angular');
Expand All @@ -24,7 +24,8 @@ angular.module('nemLogging').provider('nemDebug', function (){

return this;
});
var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
slice = [].slice;

angular.module('nemLogging').provider('nemSimpleLogger', [
'nemDebugProvider', function(nemDebugProvider) {
Expand Down Expand Up @@ -91,10 +92,12 @@ angular.module('nemLogging').provider('nemSimpleLogger', [
fn1 = (function(_this) {
return function(level) {
logFns[level] = function() {
var args;
args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
if (_this.doLog) {
return _maybeExecLevel(LEVELS[level], _this.currentLevel, function() {
var ref;
return (ref = _this.$log)[level].apply(ref, arguments);
return (ref = _this.$log)[level].apply(ref, args);
});
}
};
Expand Down
Loading

0 comments on commit 06fc827

Please sign in to comment.