@putkoff/abstract-logger 0.0.29 → 0.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +13 -15
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +13 -15
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -14470,20 +14470,21 @@ const IS_BROWSER = typeof window !== "undefined" &&
|
|
|
14470
14470
|
const IS_NODE = typeof process !== "undefined" &&
|
|
14471
14471
|
process.release?.name === "node";
|
|
14472
14472
|
|
|
14473
|
-
function parseList(value) {
|
|
14474
|
-
return value
|
|
14475
|
-
? value.split(",").map(s => s.trim()).filter(Boolean)
|
|
14476
|
-
: [];
|
|
14477
|
-
}
|
|
14478
14473
|
function getLogConfig() {
|
|
14479
14474
|
return {
|
|
14480
14475
|
condensed: process.env.LOG_CONDENSED !== "false",
|
|
14481
14476
|
expandOnDebug: process.env.LOG_EXPAND_DEBUG !== "false",
|
|
14482
14477
|
showDetails: process.env.LOG_SHOW_DETAILS !== "false",
|
|
14483
14478
|
maxDetailsLength: Number(process.env.LOG_DETAILS_MAX ?? 500),
|
|
14484
|
-
showDetailslist:
|
|
14485
|
-
|
|
14486
|
-
|
|
14479
|
+
showDetailslist: process.env.LOG_DETAILS_ALLOWLIST
|
|
14480
|
+
? process.env.LOG_DETAILS_ALLOWLIST.split(",").map(s => s.trim())
|
|
14481
|
+
: [],
|
|
14482
|
+
functionAllowlist: process.env.LOG_FUNCTION_ALLOWLIST
|
|
14483
|
+
? process.env.LOG_FUNCTION_ALLOWLIST.split(",").map(s => s.trim())
|
|
14484
|
+
: [],
|
|
14485
|
+
functionBlocklist: process.env.LOG_FUNCTION_BLOCKLIST
|
|
14486
|
+
? process.env.LOG_FUNCTION_BLOCKLIST.split(",").map(s => s.trim())
|
|
14487
|
+
: [],
|
|
14487
14488
|
};
|
|
14488
14489
|
}
|
|
14489
14490
|
|
|
@@ -14513,14 +14514,11 @@ function shouldCondense(logType) {
|
|
|
14513
14514
|
return LOG_CONFIG.condensed;
|
|
14514
14515
|
}
|
|
14515
14516
|
function shouldShowDetails(logType) {
|
|
14516
|
-
const
|
|
14517
|
-
|
|
14518
|
-
|
|
14519
|
-
if (allow.length > 0) {
|
|
14520
|
-
return allow.includes(logType);
|
|
14517
|
+
const cfg = getLogConfig();
|
|
14518
|
+
if (cfg.showDetailslist.length > 0) {
|
|
14519
|
+
return cfg.showDetailslist.includes(logType);
|
|
14521
14520
|
}
|
|
14522
|
-
|
|
14523
|
-
return LOG_CONFIG.showDetails;
|
|
14521
|
+
return cfg.showDetails;
|
|
14524
14522
|
}
|
|
14525
14523
|
/** Exported logger */
|
|
14526
14524
|
const logger = nodeLogger;
|