Skip to content

Commit

Permalink
Release version 1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pimterry committed Sep 11, 2017
1 parent 25ef8ed commit 344fd1b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,8 @@ v1.4.0 - Add getLevel(), setDefaultLevel() and getLogger() functionality for mor

v1.4.1 - Reorder UMD (#92) to improve bundling tool compatibility

v1.5.0 - Fix log.debug (#111) after V8 changes deprecating console.debug, check for `window` upfront (#104), and add `.log` alias for `.debug` (#64)

## License
Copyright (c) 2013 Tim Perry
Licensed under the MIT license.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "loglevel",
"version": "1.4.1",
"version": "1.5.0",
"main": "dist/loglevel.min.js",
"dependencies": {},
"ignore": [
Expand Down
13 changes: 12 additions & 1 deletion dist/loglevel.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! loglevel - v1.4.1 - https://github.com/pimterry/loglevel - (c) 2017 Tim Perry - licensed MIT */
/*! loglevel - v1.5.0 - https://github.com/pimterry/loglevel - (c) 2017 Tim Perry - licensed MIT */
(function (root, definition) {
"use strict";
if (typeof define === 'function' && define.amd) {
Expand Down Expand Up @@ -43,6 +43,10 @@
// Build the best logging method possible for this env
// Wherever possible we want to bind, not wrap, to preserve stack traces
function realMethod(methodName) {
if (methodName === 'debug') {
methodName = 'log';
}

if (typeof console === undefinedType) {
return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives
} else if (console[methodName] !== undefined) {
Expand All @@ -64,6 +68,9 @@
noop :
this.methodFactory(methodName, level, loggerName);
}

// Define log.log as an alias for log.debug
this.log = this.debug;
}

// In old IE versions, the console isn't present until you first open it.
Expand Down Expand Up @@ -96,6 +103,8 @@
function persistLevelIfPossible(levelNum) {
var levelName = (logMethods[levelNum] || 'silent').toUpperCase();

if (typeof window === undefinedType) return;

// Use localStorage if available
try {
window.localStorage[storageKey] = levelName;
Expand All @@ -112,6 +121,8 @@
function getPersistedLevel() {
var storedLevel;

if (typeof window === undefinedType) return;

try {
storedLevel = window.localStorage[storageKey];
} catch (ignore) {}
Expand Down
4 changes: 2 additions & 2 deletions dist/loglevel.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 package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "loglevel",
"description": "Minimal lightweight logging for JavaScript, adding reliable log level methods to any available console.log methods",
"version": "1.4.1",
"version": "1.5.0",
"homepage": "https://github.com/pimterry/loglevel",
"author": {
"name": "Tim Perry",
Expand Down

0 comments on commit 344fd1b

Please sign in to comment.