oasis-std
Advanced tools
Comparing version 0.1.0-rc.37 to 0.1.0-rc.38
@@ -16,28 +16,22 @@ "use strict"; | ||
let logLevel = 'silent'; // default | ||
// Look at either the node or the browser env. | ||
if (isNode) { | ||
const spec = (_a = process.env.OASIS_SDK_LOG_LEVEL) !== null && _a !== void 0 ? _a : ''; | ||
for (const subspec of spec.split(',')) { | ||
if (subspec === '') { | ||
continue; | ||
const spec = (_a = process.env.OASIS_SDK_LOG_LEVEL) !== null && _a !== void 0 ? _a : ''; | ||
for (const subspec of spec.split(',')) { | ||
if (subspec === '') { | ||
continue; | ||
} | ||
else if (subspec.indexOf('=') === -1) { | ||
// Simple subspec -- just the level | ||
logLevel = subspec; | ||
} | ||
else { | ||
const [pattern, level] = subspec.split('=', 2); | ||
try { | ||
if (new RegExp(pattern).test(name)) | ||
logLevel = level; | ||
} | ||
else if (subspec.indexOf('=') === -1) { | ||
// Simple subspec -- just the level | ||
logLevel = subspec; | ||
catch (_b) { | ||
// A malformed regex, most likely. Ignore silently. | ||
} | ||
else { | ||
const [pattern, level] = subspec.split('=', 2); | ||
try { | ||
if (new RegExp(pattern).test(name)) | ||
logLevel = level; | ||
} | ||
catch (_b) { | ||
// A malformed regex, most likely. Ignore silently. | ||
} | ||
} | ||
} | ||
} | ||
else { | ||
logLevel = location.hostname === 'localhost' ? 'debug' : 'silent'; | ||
} | ||
// If env requested some logging, but it's not a recognized level, | ||
@@ -66,5 +60,7 @@ if (pino_1.default.levels.values[logLevel] === undefined) { | ||
name, | ||
timestamp: pino_1.default.stdTimeFunctions.isoTime, | ||
serializers: { err: pino_1.default.stdSerializers.err }, | ||
level: logLevelFromEnv(name), | ||
// ISO format instead of epoch for Node API | ||
// Note that Browser API does not support time | ||
timestamp: isNode ? pino_1.default.stdTimeFunctions.isoTime : undefined, | ||
// Append "v":"1" to log messages so bunyan recognizes them as pretty-printable. | ||
@@ -71,0 +67,0 @@ mixin() { |
{ | ||
"name": "oasis-std", | ||
"version": "0.1.0-rc.37", | ||
"version": "0.1.0-rc.38", | ||
"description": "Oasis platform standard library", | ||
@@ -31,3 +31,3 @@ "license": "Apache-2.0", | ||
}, | ||
"gitHead": "53ebecbf98ec71c1a648dfa1ab282ff85186412f" | ||
"gitHead": "f7275f635d5238e8c9d21c1f3a623c774a1b2767" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
294397
1982
2