Skip to content

Commit

Permalink
Release version 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Perry committed Jun 3, 2015
1 parent c0051e9 commit 6020024
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ v1.1.0 - Added support for including loglevel with preprocessing and .apply() (#

v1.2.0 - New plugin API! Plus various bits of refactoring and tidy up, nicely simplifying things and trimming the size down.

v1.3.0 - Make persistence optional in setLevel, plus lots of documentation updates and other small tweaks

## License
Copyright (c) 2013 Tim Perry
Licensed under the MIT license.
Expand Down
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.2.0",
"version": "1.3.0",
"main": "dist/loglevel.min.js",
"dependencies": {},
"ignore": [
Expand Down
16 changes: 9 additions & 7 deletions dist/loglevel.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! loglevel - v1.2.0 - https://github.com/pimterry/loglevel - (c) 2014 Tim Perry - licensed MIT */
/*! loglevel - v1.3.0 - https://github.com/pimterry/loglevel - (c) 2015 Tim Perry - licensed MIT */
(function (root, definition) {
if (typeof module === 'object' && module.exports && typeof require === 'function') {
module.exports = definition();
Expand Down Expand Up @@ -113,12 +113,14 @@
enableLoggingWhenConsoleArrives(methodName, level);
};

self.setLevel = function (level) {
self.setLevel = function (level, persist) {
if (typeof level === "string" && self.levels[level.toUpperCase()] !== undefined) {
level = self.levels[level.toUpperCase()];
}
if (typeof level === "number" && level >= 0 && level <= self.levels.SILENT) {
persistLevelIfPossible(level);
if (persist !== false) { // defaults to true
persistLevelIfPossible(level);
}
replaceLoggingMethods(level);
if (typeof console === undefinedType && level < self.levels.SILENT) {
return "No console available for logging";
Expand All @@ -128,12 +130,12 @@
}
};

self.enableAll = function() {
self.setLevel(self.levels.TRACE);
self.enableAll = function(persist) {
self.setLevel(self.levels.TRACE, persist);
};

self.disableAll = function() {
self.setLevel(self.levels.SILENT);
self.disableAll = function(persist) {
self.setLevel(self.levels.SILENT, persist);
};

// Grab the current global log variable in case of overwrite
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.2.0",
"version": "1.3.0",
"homepage": "https://github.com/pimterry/loglevel",
"author": {
"name": "Tim Perry",
Expand Down

0 comments on commit 6020024

Please sign in to comment.