@dbux/common
Advanced tools
Comparing version 0.1.5 to 0.1.7
{ | ||
"name": "@dbux/common", | ||
"version": "0.1.5", | ||
"version": "0.1.7", | ||
"description": "", | ||
@@ -17,3 +17,3 @@ "module": "src/index.js", | ||
"_moduleAliases": {}, | ||
"gitHead": "8b86112956ad0ffdda025886b1503ea3a1ba4959" | ||
"gitHead": "fab42020aa9f1914b0af362496ed930343164f78" | ||
} |
/* eslint no-console: 0 */ | ||
import NanoEvents from 'nanoevents'; | ||
import EmptyArray from '../util/EmptyArray'; | ||
@@ -81,2 +82,3 @@ const errors = []; | ||
const f = logFunctions[name]; | ||
// const nsArgs = (ns && [ns] || EmptyArray); | ||
this[name] = (...args) => { | ||
@@ -91,3 +93,3 @@ f(ns, ...args); | ||
export function newLogger(ns) { | ||
return new Logger(`DBUX ${ns}`); | ||
return new Logger(ns && `DBUX ${ns}`); | ||
} | ||
@@ -132,4 +134,8 @@ | ||
function wrapNs(ns) { | ||
return ns && `[${ns}]` || ''; | ||
} | ||
export function loglog(ns, ...args) { | ||
outputStreams.log(`[${ns}]`, ...args); | ||
outputStreams.log(wrapNs(ns), ...args); | ||
} | ||
@@ -140,10 +146,10 @@ | ||
// color decoration | ||
// prettyDebug(`[${ns}]`, ...args); | ||
// prettyDebug(wrapNs(ns), ...args); | ||
// no color | ||
outputStreams.debug(`[${ns}]`, ...args); | ||
outputStreams.debug(wrapNs(ns), ...args); | ||
} | ||
export function logWarn(ns, ...args) { | ||
ns = `[${ns}]`; | ||
ns = wrapNs(ns); | ||
outputStreams.warn(ns, ...args); | ||
@@ -154,3 +160,3 @@ report('warn', ns, ...args); | ||
export function logError(ns, ...args) { | ||
ns = `[${ns}]`; | ||
ns = wrapNs(ns); | ||
outputStreams.error(ns, ...args); | ||
@@ -157,0 +163,0 @@ report('error', ns, ...args); |
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
64640
1884