@putkoff/abstract-logger 0.0.75 → 0.0.76

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
@@ -127,6 +127,7 @@ function getLogConfig() {
127
127
  expandOnDebug: getEnvValue({ key: "LOG_EXPAND_DEBUG" }) !== "false",
128
128
  showDetails: getEnvValue({ key: "LOG_SHOW_DETAILS" }) !== "false",
129
129
  showOnly: getEnvValue({ key: "LOG_SHOW_ONLY" }) === "true",
130
+ functionAllowlistStrict: getEnvValue({ key: "LOG_FUNCTION_ALLOWLIST_STRICT" }) === "true",
130
131
  showOnlyFunctions: parseList$1("LOG_SHOW_ONLY_FUNCTIONS"),
131
132
  showOnlyActivities: parseList$1("LOG_SHOW_ONLY_ACTIVITIES"),
132
133
  showOnlyTypes: parseList$1("LOG_SHOW_ONLY_TYPES"),
@@ -14968,17 +14969,10 @@ function shouldLog(opts, caller) {
14968
14969
  if (cfg.showOnlyTypes.length &&
14969
14970
  !cfg.showOnlyTypes.includes(type))
14970
14971
  return false;
14971
- return true; // 👈 NOTHING ELSE APPLIES
14972
- }
14973
- // ─────────────────────────────────────
14974
- // 1️⃣ Hard allowlist
14975
- // ─────────────────────────────────────
14976
- if (cfg.functionAllowlist.length > 0) {
14977
- if (!cfg.functionAllowlist.includes(fn))
14978
- return false;
14972
+ return true;
14979
14973
  }
14980
14974
  // ─────────────────────────────────────
14981
- // 2️⃣ Hard blocklists
14975
+ // 1️⃣ Hard blocklists (ALWAYS APPLY)
14982
14976
  // ─────────────────────────────────────
14983
14977
  if (cfg.functionBlocklist.includes(fn))
14984
14978
  return false;
@@ -14987,7 +14981,16 @@ function shouldLog(opts, caller) {
14987
14981
  if (cfg.logTypeBlocklist.includes(type))
14988
14982
  return false;
14989
14983
  // ─────────────────────────────────────
14990
- // 3️⃣ Burst protection (debug)
14984
+ // 2️⃣ Function allowlist (optional narrowing)
14985
+ // ─────────────────────────────────────
14986
+ if (cfg.functionAllowlist.length > 0) {
14987
+ const allowed = cfg.functionAllowlist.includes(fn);
14988
+ if (!allowed && cfg.functionAllowlistStrict) {
14989
+ return false;
14990
+ }
14991
+ }
14992
+ // ─────────────────────────────────────
14993
+ // 3️⃣ Burst protection (debug only)
14991
14994
  // ─────────────────────────────────────
14992
14995
  if (type === "debug") {
14993
14996
  const key = fn + ":" + message;