From e9100d4887ad54c2f5f7836caca08f06b23fa3f2 Mon Sep 17 00:00:00 2001 From: Tim Perry Date: Thu, 7 Nov 2019 18:11:03 +0100 Subject: [PATCH] v1.6.6 --- README.md | 2 ++ bower.json | 2 +- dist/loglevel.js | 16 +++++++++++----- dist/loglevel.min.js | 4 ++-- package.json | 2 +- 5 files changed, 17 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 8190dae..fef8c5e 100644 --- a/README.md +++ b/README.md @@ -324,6 +324,8 @@ v1.6.4 - Ensure package.json's 'main' is a fully qualified path, to fix webpack v1.6.5 - Ensure the provided message is included when calling trace() in IE11 +v1.6.6 - Fix bugs in v1.6.5, which caused issues in node.js & IE < 9 + ## License Copyright (c) 2013 Tim Perry Licensed under the MIT license. diff --git a/bower.json b/bower.json index a585f80..1f8d558 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "loglevel", - "version": "1.6.5", + "version": "1.6.6", "main": "dist/loglevel.min.js", "dependencies": {}, "ignore": [ diff --git a/dist/loglevel.js b/dist/loglevel.js index 2b479d4..40bdb91 100644 --- a/dist/loglevel.js +++ b/dist/loglevel.js @@ -1,4 +1,4 @@ -/*! loglevel - v1.6.5 - https://github.com/pimterry/loglevel - (c) 2019 Tim Perry - licensed MIT */ +/*! loglevel - v1.6.6 - https://github.com/pimterry/loglevel - (c) 2019 Tim Perry - licensed MIT */ (function (root, definition) { "use strict"; if (typeof define === 'function' && define.amd) { @@ -14,9 +14,8 @@ // Slightly dubious tricks to cut down minimized file size var noop = function() {}; var undefinedType = "undefined"; - var isIE = ( - window.navigator.userAgent.indexOf('Trident/') >= 0 || - window.navigator.userAgent.indexOf('MSIE ') >= 0 + var isIE = (typeof window !== undefinedType) && ( + /Trident\/|MSIE /.test(window.navigator.userAgent) ); var logMethods = [ @@ -46,7 +45,14 @@ // Trace() doesn't print the message in IE, so for that case we need to wrap it function traceForIE() { - if (console.log) console.log.apply(console, arguments); + if (console.log) { + if (console.log.apply) { + console.log.apply(console, arguments); + } else { + // In old IE, native console methods themselves don't have apply(). + Function.prototype.apply.apply(console.log, [console, arguments]); + } + } if (console.trace) console.trace(); } diff --git a/dist/loglevel.min.js b/dist/loglevel.min.js index 9e9738e..5a56263 100644 --- a/dist/loglevel.min.js +++ b/dist/loglevel.min.js @@ -1,2 +1,2 @@ -/*! loglevel - v1.6.5 - https://github.com/pimterry/loglevel - (c) 2019 Tim Perry - licensed MIT */ -!function(a,b){"use strict";"function"==typeof define&&define.amd?define(b):"object"==typeof module&&module.exports?module.exports=b():a.log=b()}(this,function(){"use strict";function a(a,b){var c=a[b];if("function"==typeof c.bind)return c.bind(a);try{return Function.prototype.bind.call(c,a)}catch(b){return function(){return Function.prototype.apply.apply(c,[a,arguments])}}}function b(){console.log&&console.log.apply(console,arguments),console.trace&&console.trace()}function c(c){return"debug"===c&&(c="log"),typeof console!==i&&("trace"===c&&j?b:void 0!==console[c]?a(console,c):void 0!==console.log?a(console,"log"):h)}function d(a,b){for(var c=0;c=0&&b<=j.levels.SILENT))throw"log.setLevel() called with invalid level: "+b;if(h=b,!1!==c&&e(b),d.call(j,b,a),typeof console===i&&b=0||window.navigator.userAgent.indexOf("MSIE ")>=0,k=["trace","debug","info","warn","error"],l=new g,m={};l.getLogger=function(a){if("string"!=typeof a||""===a)throw new TypeError("You must supply a name when creating a logger.");var b=m[a];return b||(b=m[a]=new g(a,l.getLevel(),l.methodFactory)),b};var n=typeof window!==i?window.log:void 0;return l.noConflict=function(){return typeof window!==i&&window.log===l&&(window.log=n),l},l.getLoggers=function(){return m},l}); \ No newline at end of file +/*! loglevel - v1.6.6 - https://github.com/pimterry/loglevel - (c) 2019 Tim Perry - licensed MIT */ +!function(a,b){"use strict";"function"==typeof define&&define.amd?define(b):"object"==typeof module&&module.exports?module.exports=b():a.log=b()}(this,function(){"use strict";function a(a,b){var c=a[b];if("function"==typeof c.bind)return c.bind(a);try{return Function.prototype.bind.call(c,a)}catch(b){return function(){return Function.prototype.apply.apply(c,[a,arguments])}}}function b(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(c){return"debug"===c&&(c="log"),typeof console!==i&&("trace"===c&&j?b:void 0!==console[c]?a(console,c):void 0!==console.log?a(console,"log"):h)}function d(a,b){for(var c=0;c=0&&b<=j.levels.SILENT))throw"log.setLevel() called with invalid level: "+b;if(h=b,!1!==c&&e(b),d.call(j,b,a),typeof console===i&&b