@ascot/log
Advanced tools
Comparing version 2.0.28 to 2.0.29
@@ -26,8 +26,10 @@ "use strict"; | ||
(function (logs) { | ||
let loggerConfig = { | ||
name: null, | ||
level: models_1.DEFAULT_LOG_LEVEL | ||
}; | ||
function config() { | ||
return global.logger || { | ||
name: null, | ||
level: models_1.DEFAULT_LOG_LEVEL | ||
}; | ||
} | ||
; | ||
function setup(config) { | ||
loggerConfig = config; | ||
global.logger = config; | ||
@@ -64,2 +66,3 @@ process.on("unhandledRejection", (reason, promise) => onUnhandledRejection(reason, promise)); | ||
options = options || {}; | ||
let loggerConfig = config(); | ||
if (loggerConfig && !loggerConfig.name) { | ||
@@ -99,2 +102,3 @@ try { | ||
const typeFn = models_1.LogLevelColors[level]; | ||
let loggerConfig = config(); | ||
let prefix = options && options.prefix; | ||
@@ -151,3 +155,2 @@ let name = loggerConfig.name || "?"; | ||
logs.colors = chalk_1.default; | ||
loggerConfig = global.logger || { level: "verbose" }; | ||
/* | ||
@@ -154,0 +157,0 @@ export function stream(options: { prefix: string; level?: LogLevel; }) { |
@@ -8,3 +8,3 @@ { | ||
}, | ||
"version": "2.0.28" | ||
"version": "2.0.29" | ||
} |
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
11986
288