@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 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: parseList(process.env.LOG_DETAILS_ALLOWLIST),
14485
- functionAllowlist: parseList(process.env.LOG_FUNCTION_ALLOWLIST),
14486
- functionBlocklist: parseList(process.env.LOG_FUNCTION_BLOCKLIST),
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 LOG_CONFIG = getLogConfig();
14517
- const allow = LOG_CONFIG.showDetailslist;
14518
- // If allowlist exists, it RESTRICTS
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
- // Otherwise fall back to global flag
14523
- return LOG_CONFIG.showDetails;
14521
+ return cfg.showDetails;
14524
14522
  }
14525
14523
  /** Exported logger */
14526
14524
  const logger = nodeLogger;