@putkoff/abstract-logger 0.0.49 → 0.0.50
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 +14 -23
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/config.d.ts +5 -5
- package/dist/esm/index.js +14 -23
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/config.d.ts +5 -5
- package/dist/types/config.d.ts +5 -5
- package/dist/types/index.d.ts +5 -5
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -42,7 +42,7 @@ function resolveValue(...values) {
|
|
|
42
42
|
}
|
|
43
43
|
return sawInput ? "unknown" : "unknown";
|
|
44
44
|
}
|
|
45
|
-
function parseList(value) {
|
|
45
|
+
function parseList$1(value) {
|
|
46
46
|
return value
|
|
47
47
|
? value.split(",").map(s => s.trim()).filter(Boolean)
|
|
48
48
|
: [];
|
|
@@ -288,45 +288,36 @@ function getEnvValue(options = {}) {
|
|
|
288
288
|
return env.envValue;
|
|
289
289
|
}
|
|
290
290
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
291
|
+
function parseList(key) {
|
|
292
|
+
const v = getEnvValue({ key });
|
|
293
|
+
return v ? v.split(",").map(s => s.trim()).filter(Boolean) : [];
|
|
294
|
+
}
|
|
294
295
|
function getLogConfig() {
|
|
295
296
|
return {
|
|
296
297
|
condensed: getEnvValue({ key: "LOG_CONDENSED" }) !== "false",
|
|
297
298
|
expandOnDebug: getEnvValue({ key: "LOG_EXPAND_DEBUG" }) !== "false",
|
|
298
299
|
showDetails: getEnvValue({ key: "LOG_SHOW_DETAILS" }) !== "false",
|
|
299
300
|
maxDetailsLength: Number(getEnvValue({ key: "LOG_DETAILS_MAX" }) ?? 500),
|
|
300
|
-
|
|
301
|
-
logTypeBlocklist: parse$1(getEnvValue({ key: "LOG_TYPE_BLOCKLIST" }) || ""),
|
|
302
|
-
sampleRate: Number(getEnvValue({ key: "LOG_SAMPLE_RATE" }) ?? 1), // 0–1
|
|
303
|
-
// 👇 NEW
|
|
301
|
+
sampleRate: Number(getEnvValue({ key: "LOG_SAMPLE_RATE" }) ?? 1),
|
|
304
302
|
prettyDetails: getEnvValue({ key: "LOG_PRETTY_DETAILS" }) === "true",
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
functionAllowlist:
|
|
309
|
-
|
|
310
|
-
: [],
|
|
311
|
-
functionBlocklist: getEnvValue({ key: "LOG_FUNCTION_BLOCKLIST" })
|
|
312
|
-
? getEnvValue({ key: "LOG_FUNCTION_BLOCKLIST" }) || "".split(",").map(s => s.trim())
|
|
313
|
-
: [],
|
|
303
|
+
activityBlocklist: parseList("LOG_ACTIVITY_BLOCKLIST"),
|
|
304
|
+
logTypeBlocklist: parseList("LOG_TYPE_BLOCKLIST"),
|
|
305
|
+
showDetailslist: parseList("LOG_DETAILS_ALLOWLIST"),
|
|
306
|
+
functionAllowlist: parseList("LOG_FUNCTION_ALLOWLIST"),
|
|
307
|
+
functionBlocklist: parseList("LOG_FUNCTION_BLOCKLIST"),
|
|
314
308
|
};
|
|
315
309
|
}
|
|
316
310
|
function debugLogConfig() {
|
|
317
311
|
if (getEnvValue({ key: "LOG_DEBUG_CONFIG" }) === "true") {
|
|
318
|
-
console.log("LOG CONFIG ENV:"
|
|
312
|
+
console.log("LOG CONFIG ENV:", {
|
|
319
313
|
LOG_SHOW_DETAILS: getEnvValue({ key: "LOG_SHOW_DETAILS" }),
|
|
320
314
|
LOG_DETAILS_ALLOWLIST: getEnvValue({ key: "LOG_DETAILS_ALLOWLIST" }),
|
|
321
315
|
LOG_PRETTY_DETAILS: getEnvValue({ key: "LOG_PRETTY_DETAILS" }),
|
|
322
316
|
LOG_CONDENSED: getEnvValue({ key: "LOG_CONDENSED" }),
|
|
323
317
|
LOG_EXPAND_DEBUG: getEnvValue({ key: "LOG_EXPAND_DEBUG" }),
|
|
324
|
-
};
|
|
318
|
+
});
|
|
325
319
|
}
|
|
326
320
|
}
|
|
327
|
-
function parse$1(v) {
|
|
328
|
-
return v ? v.split(",").map(s => s.trim()) : [];
|
|
329
|
-
}
|
|
330
321
|
|
|
331
322
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
332
323
|
|
|
@@ -15005,7 +14996,7 @@ exports.getNodeLogger = getNodeLogger;
|
|
|
15005
14996
|
exports.logger = logger;
|
|
15006
14997
|
exports.padLeft = padLeft;
|
|
15007
14998
|
exports.padRight = padRight;
|
|
15008
|
-
exports.parseList = parseList;
|
|
14999
|
+
exports.parseList = parseList$1;
|
|
15009
15000
|
exports.resolveLogger = resolveLogger;
|
|
15010
15001
|
exports.resolveValue = resolveValue;
|
|
15011
15002
|
exports.serializeDetails = serializeDetails;
|