@gigafied/log
Advanced tools
Comparing version 0.3.0 to 0.4.0
39
index.js
(function (root) { | ||
'use strict' | ||
root.process = root.process || {} | ||
root.process.env = root.process.env || {} | ||
var levels = ['critical', 'error', 'warn', 'info', 'verbose', 'debug', 'silly'] | ||
@@ -55,3 +58,3 @@ | ||
var i, log, args, logArgs | ||
var styles = sayin.themes[theme] | ||
var styles = logger.themes[theme] | ||
if (isMuted || !shouldLog(namespace, levelIdx) || !(log = root.console && root.console[method])) return | ||
@@ -105,3 +108,3 @@ args = Array.prototype.slice.call(arguments, 2) | ||
setLevel: function (level) { | ||
sayin.setLevel(namespace, level) | ||
logger.setLevel(namespace, level) | ||
}, | ||
@@ -115,3 +118,3 @@ mute: function () { isMuted = true }, | ||
if (isMuted) return | ||
sayin[level].apply(null, [namespace].concat(arguments)) | ||
log[level].apply(null, [namespace].concat(arguments)) | ||
} | ||
@@ -121,3 +124,3 @@ } | ||
level = levels[i] | ||
ret[level] = doWrap(level, sayin[level]) | ||
ret[level] = doWrap(level, log[level]) | ||
} | ||
@@ -137,3 +140,3 @@ return ret | ||
var sayin = { | ||
var logger = { | ||
critical: wrapConsole('critical', 'error'), | ||
@@ -143,3 +146,3 @@ error: wrapConsole('error', 'error'), | ||
info: wrapConsole('info', 'info'), | ||
debug: wrapConsole('debug', 'log'), | ||
debug: wrapConsole('debug', 'logger'), | ||
verbose: wrapConsole('verbose', 'debug'), | ||
@@ -152,4 +155,4 @@ silly: wrapConsole('silly', 'debug'), | ||
unmute: function () { isMuted = false }, | ||
enableTimes: function () { doLogTimes = true }, | ||
disableTimes: function () { doLogTimes = false }, | ||
enableTimes: function () { dologgerTimes = true }, | ||
disableTimes: function () { dologgerTimes = false }, | ||
wrap: wrap, | ||
@@ -165,15 +168,15 @@ themes: themes, | ||
namespaces = {default: 6} | ||
sayin.critical('test', 'Some critical issue...') | ||
sayin.error('test', new Error('There was an error')) | ||
sayin.warn('test', 'I\'m warning you!') | ||
sayin.info('test', 'The quick brown fox') | ||
sayin.verbose('test', 'well, I do say...') | ||
sayin.debug('test', 'jumped over the lazy dog') | ||
sayin.silly('test', 'Everyday I\'m shuffling') | ||
logger.critical('test', 'Some critical issue...') | ||
logger.error('test', new Error('There was an error')) | ||
logger.warn('test', 'I\'m warning you!') | ||
logger.info('test', 'The quick brown fox') | ||
logger.verbose('test', 'well, I do say...') | ||
logger.debug('test', 'jumped over the lazy dog') | ||
logger.silly('test', 'Everyday I\'m shuffling') | ||
namespaces.default = before | ||
} | ||
if (root && typeof root.define === 'function' && root.define.amd) root.define([]) | ||
else if (typeof module !== 'undefined' && module.exports) module.exports = sayin | ||
else root.sayin = sayin | ||
if (typeof define === 'function' && define.amd) define([], logger) | ||
else if (typeof module !== 'undefined' && module.exports) module.exports = logger | ||
else root.log = logger | ||
})(typeof global !== 'undefined' ? global : window || this) |
{ | ||
"name": "@gigafied/log", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "description": "Browser Logging", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5677
155