@putkoff/abstract-logger 0.0.28 → 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 +18 -18
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/logger/logger.d.ts +1 -0
- package/dist/esm/index.js +18 -18
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/logger/logger.d.ts +1 -0
- package/dist/types/logger/logger.d.ts +1 -0
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -10,6 +10,7 @@ import require$$1 from 'tty';
|
|
|
10
10
|
import require$$1$1 from 'string_decoder';
|
|
11
11
|
import require$$0$7 from 'http';
|
|
12
12
|
import require$$1$3 from 'https';
|
|
13
|
+
import 'dotenv/config';
|
|
13
14
|
|
|
14
15
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
15
16
|
|
|
@@ -14467,26 +14468,28 @@ const IS_BROWSER = typeof window !== "undefined" &&
|
|
|
14467
14468
|
const IS_NODE = typeof process !== "undefined" &&
|
|
14468
14469
|
process.release?.name === "node";
|
|
14469
14470
|
|
|
14470
|
-
function parseList(value) {
|
|
14471
|
-
return value
|
|
14472
|
-
? value.split(",").map(s => s.trim()).filter(Boolean)
|
|
14473
|
-
: [];
|
|
14474
|
-
}
|
|
14475
14471
|
function getLogConfig() {
|
|
14476
14472
|
return {
|
|
14477
14473
|
condensed: process.env.LOG_CONDENSED !== "false",
|
|
14478
14474
|
expandOnDebug: process.env.LOG_EXPAND_DEBUG !== "false",
|
|
14479
14475
|
showDetails: process.env.LOG_SHOW_DETAILS !== "false",
|
|
14480
14476
|
maxDetailsLength: Number(process.env.LOG_DETAILS_MAX ?? 500),
|
|
14481
|
-
showDetailslist:
|
|
14482
|
-
|
|
14483
|
-
|
|
14477
|
+
showDetailslist: process.env.LOG_DETAILS_ALLOWLIST
|
|
14478
|
+
? process.env.LOG_DETAILS_ALLOWLIST.split(",").map(s => s.trim())
|
|
14479
|
+
: [],
|
|
14480
|
+
functionAllowlist: process.env.LOG_FUNCTION_ALLOWLIST
|
|
14481
|
+
? process.env.LOG_FUNCTION_ALLOWLIST.split(",").map(s => s.trim())
|
|
14482
|
+
: [],
|
|
14483
|
+
functionBlocklist: process.env.LOG_FUNCTION_BLOCKLIST
|
|
14484
|
+
? process.env.LOG_FUNCTION_BLOCKLIST.split(",").map(s => s.trim())
|
|
14485
|
+
: [],
|
|
14484
14486
|
};
|
|
14485
14487
|
}
|
|
14486
14488
|
|
|
14487
|
-
|
|
14488
|
-
|
|
14489
|
-
|
|
14489
|
+
console.log("ENV CHECK:", {
|
|
14490
|
+
LOG_SHOW_DETAILS: process.env.LOG_SHOW_DETAILS,
|
|
14491
|
+
LOG_DETAILS_ALLOWLIST: process.env.LOG_DETAILS_ALLOWLIST,
|
|
14492
|
+
});
|
|
14490
14493
|
let nodeLogger = null;
|
|
14491
14494
|
if (IS_NODE) {
|
|
14492
14495
|
nodeLogger = winston.createLogger({
|
|
@@ -14509,14 +14512,11 @@ function shouldCondense(logType) {
|
|
|
14509
14512
|
return LOG_CONFIG.condensed;
|
|
14510
14513
|
}
|
|
14511
14514
|
function shouldShowDetails(logType) {
|
|
14512
|
-
const
|
|
14513
|
-
|
|
14514
|
-
|
|
14515
|
-
if (allow.length > 0) {
|
|
14516
|
-
return allow.includes(logType);
|
|
14515
|
+
const cfg = getLogConfig();
|
|
14516
|
+
if (cfg.showDetailslist.length > 0) {
|
|
14517
|
+
return cfg.showDetailslist.includes(logType);
|
|
14517
14518
|
}
|
|
14518
|
-
|
|
14519
|
-
return LOG_CONFIG.showDetails;
|
|
14519
|
+
return cfg.showDetails;
|
|
14520
14520
|
}
|
|
14521
14521
|
/** Exported logger */
|
|
14522
14522
|
const logger = nodeLogger;
|