@putkoff/abstract-logger 0.0.50 → 0.0.51

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
@@ -292,11 +292,13 @@ function parseList(key) {
292
292
  const v = getEnvValue({ key });
293
293
  return v ? v.split(",").map(s => s.trim()).filter(Boolean) : [];
294
294
  }
295
- function getLogConfig() {
295
+ let cachedConfig = null;
296
+ function buildLogConfig() {
296
297
  return {
297
298
  condensed: getEnvValue({ key: "LOG_CONDENSED" }) !== "false",
298
299
  expandOnDebug: getEnvValue({ key: "LOG_EXPAND_DEBUG" }) !== "false",
299
300
  showDetails: getEnvValue({ key: "LOG_SHOW_DETAILS" }) !== "false",
301
+ envlockdown: getEnvValue({ key: "LOCKDOWN" }) !== "false",
300
302
  maxDetailsLength: Number(getEnvValue({ key: "LOG_DETAILS_MAX" }) ?? 500),
301
303
  sampleRate: Number(getEnvValue({ key: "LOG_SAMPLE_RATE" }) ?? 1),
302
304
  prettyDetails: getEnvValue({ key: "LOG_PRETTY_DETAILS" }) === "true",
@@ -307,6 +309,16 @@ function getLogConfig() {
307
309
  functionBlocklist: parseList("LOG_FUNCTION_BLOCKLIST"),
308
310
  };
309
311
  }
312
+ function getLogConfig() {
313
+ if (!cachedConfig) {
314
+ const params = buildLogConfig();
315
+ if (!params.envlockdown) {
316
+ cachedConfig = params;
317
+ }
318
+ return params;
319
+ }
320
+ return cachedConfig;
321
+ }
310
322
  function debugLogConfig() {
311
323
  if (getEnvValue({ key: "LOG_DEBUG_CONFIG" }) === "true") {
312
324
  console.log("LOG CONFIG ENV:", {