oasis-std
Advanced tools
Comparing version 0.1.0-rc.38 to 0.1.0-rc.39
@@ -10,3 +10,3 @@ import { BaseLogger as OasisLogger } from 'pino'; | ||
* Constructs a new logger named `name` with oasis-default configuration (JSON logs, UTC times, etc). | ||
* The logging level is determiend via the OASIS_SDK_LOG_LEVEL variable, which is parsed as a simple | ||
* The logging level is determined via the OASIS_SDK_LOG_LEVEL variable, which is parsed as a simple | ||
* logging spec. | ||
@@ -13,0 +13,0 @@ * |
@@ -16,3 +16,14 @@ "use strict"; | ||
let logLevel = 'silent'; // default | ||
const spec = (_a = process.env.OASIS_SDK_LOG_LEVEL) !== null && _a !== void 0 ? _a : ''; | ||
let spec = ''; | ||
/** | ||
* Support both Browser and Node.js environment with the same syntax. | ||
* `process` is not available natively in Browser. We catch the error, and rely on the default `''`. | ||
* This way, Browser applications served via Webpack and other bundlers can utilze ENV variables too. | ||
*/ | ||
try { | ||
spec = (_a = process.env.OASIS_SDK_LOG_LEVEL) !== null && _a !== void 0 ? _a : ''; | ||
} | ||
catch (_b) { | ||
// ENV variable not present. Use default empty string. | ||
} | ||
for (const subspec of spec.split(',')) { | ||
@@ -32,3 +43,3 @@ if (subspec === '') { | ||
} | ||
catch (_b) { | ||
catch (_c) { | ||
// A malformed regex, most likely. Ignore silently. | ||
@@ -47,3 +58,3 @@ } | ||
* Constructs a new logger named `name` with oasis-default configuration (JSON logs, UTC times, etc). | ||
* The logging level is determiend via the OASIS_SDK_LOG_LEVEL variable, which is parsed as a simple | ||
* The logging level is determined via the OASIS_SDK_LOG_LEVEL variable, which is parsed as a simple | ||
* logging spec. | ||
@@ -50,0 +61,0 @@ * |
{ | ||
"name": "oasis-std", | ||
"version": "0.1.0-rc.38", | ||
"version": "0.1.0-rc.39", | ||
"description": "Oasis platform standard library", | ||
@@ -31,3 +31,3 @@ "license": "Apache-2.0", | ||
}, | ||
"gitHead": "f7275f635d5238e8c9d21c1f3a623c774a1b2767" | ||
"gitHead": "5560f6a932b2fe765c43bdc39936583d490a7fe5" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
294898
1993
1