@putkoff/abstract-logger 0.0.30 โ 0.0.32
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 +90 -9
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +90 -9
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -14545,6 +14545,17 @@ function resolveValue(...values) {
|
|
|
14545
14545
|
/* ------------------------------------------------------------------ */
|
|
14546
14546
|
/* Stack inspection */
|
|
14547
14547
|
/* ------------------------------------------------------------------ */
|
|
14548
|
+
function padRight(str, width) {
|
|
14549
|
+
return str.length >= width ? str : str + " ".repeat(width - str.length);
|
|
14550
|
+
}
|
|
14551
|
+
function padLeft(str, width) {
|
|
14552
|
+
return str.length >= width ? str : " ".repeat(width - str.length) + str;
|
|
14553
|
+
}
|
|
14554
|
+
const COLS = {
|
|
14555
|
+
timestamp: 24,
|
|
14556
|
+
function: 28,
|
|
14557
|
+
file: 16,
|
|
14558
|
+
};
|
|
14548
14559
|
/* ------------------------------------------------------------------ */
|
|
14549
14560
|
/* Stack inspection */
|
|
14550
14561
|
/* ------------------------------------------------------------------ */
|
|
@@ -14660,19 +14671,83 @@ function getLogString(messageOrOptions, logType = null, details = null, function
|
|
|
14660
14671
|
resolvedFileLocation = resolveValue(file, resolvedFileLocation);
|
|
14661
14672
|
}
|
|
14662
14673
|
const emojiMap = {
|
|
14674
|
+
emitting: "๐ค",
|
|
14675
|
+
ingesting: "๐ฅ",
|
|
14676
|
+
streaming: "๐",
|
|
14677
|
+
forwarding: "โก๏ธ",
|
|
14678
|
+
receiving: "๐ก",
|
|
14679
|
+
relaying: "๐",
|
|
14680
|
+
syncing: "๐",
|
|
14681
|
+
buffering: "โณ",
|
|
14682
|
+
batching: "๐ฆ",
|
|
14683
|
+
dispatching: "๐",
|
|
14684
|
+
settings: "โ๏ธ",
|
|
14685
|
+
computing: "๐ง ",
|
|
14686
|
+
running: "๐",
|
|
14687
|
+
working: "๐ง",
|
|
14688
|
+
building: "๐๏ธ",
|
|
14689
|
+
compiling: "๐งฉ",
|
|
14690
|
+
crunching: "๐งฎ",
|
|
14691
|
+
optimizing: "๐",
|
|
14692
|
+
queued: "๐",
|
|
14693
|
+
waiting: "โณ",
|
|
14694
|
+
active: "โถ๏ธ",
|
|
14695
|
+
paused: "โธ๏ธ",
|
|
14696
|
+
sleeping: "๐ค",
|
|
14697
|
+
resumed: "๐",
|
|
14698
|
+
completed: "โ
",
|
|
14699
|
+
cancelled: "โ",
|
|
14700
|
+
expired: "โ",
|
|
14701
|
+
warning: "โ ๏ธ",
|
|
14702
|
+
error: "โ",
|
|
14703
|
+
critical: "๐จ",
|
|
14704
|
+
retrying: "๐",
|
|
14705
|
+
skipped: "โญ๏ธ",
|
|
14706
|
+
fallback: "๐",
|
|
14707
|
+
degraded: "๐",
|
|
14708
|
+
saved: "๐พ",
|
|
14709
|
+
loading: "๐",
|
|
14710
|
+
exporting: "๐ค",
|
|
14711
|
+
importing: "๐ฅ",
|
|
14712
|
+
archived: "๐๏ธ",
|
|
14713
|
+
deleted: "๐๏ธ",
|
|
14714
|
+
cached: "๐ง",
|
|
14715
|
+
persisted: "๐",
|
|
14716
|
+
locked: "๐",
|
|
14717
|
+
unlocked: "๐",
|
|
14718
|
+
secure: "๐ก๏ธ",
|
|
14719
|
+
insecure: "โ ๏ธ",
|
|
14720
|
+
verified: "โ๏ธ",
|
|
14721
|
+
blocked: "โ",
|
|
14722
|
+
allowed: "๐ข",
|
|
14723
|
+
connected: "๐",
|
|
14724
|
+
disconnected: "โ",
|
|
14725
|
+
online: "๐ข",
|
|
14726
|
+
offline: "๐ด",
|
|
14727
|
+
latency: "๐ถ",
|
|
14728
|
+
proxying: "๐งญ",
|
|
14729
|
+
broadcasting: "๐ฃ",
|
|
14730
|
+
thinking: "๐ค",
|
|
14731
|
+
learning: "๐ง ",
|
|
14732
|
+
predicting: "๐ฎ",
|
|
14733
|
+
scanning: "๐",
|
|
14734
|
+
crawling: "๐ท๏ธ",
|
|
14735
|
+
responding: "๐ฌ",
|
|
14736
|
+
generating: "โจ",
|
|
14737
|
+
debug: "๐",
|
|
14738
|
+
trace: "๐งต",
|
|
14739
|
+
inspect: "๐",
|
|
14740
|
+
test: "๐งช",
|
|
14741
|
+
mock: "๐ญ",
|
|
14742
|
+
sandbox: "๐๏ธ",
|
|
14743
|
+
experiment: "โ๏ธ",
|
|
14663
14744
|
success: "โ
",
|
|
14664
14745
|
processing: "๐",
|
|
14665
14746
|
listening: "๐ก",
|
|
14666
|
-
computing: "๐ง ",
|
|
14667
|
-
waiting: "โณ",
|
|
14668
|
-
emitting: "๐ค",
|
|
14669
|
-
ingesting: "๐ฅ",
|
|
14670
14747
|
prune: "๐งน",
|
|
14671
14748
|
connect: "๐",
|
|
14672
14749
|
info: "โน๏ธ",
|
|
14673
|
-
warn: "โ ๏ธ"
|
|
14674
|
-
error: "โ",
|
|
14675
|
-
debug: "๐",
|
|
14750
|
+
warn: "โ ๏ธ"
|
|
14676
14751
|
};
|
|
14677
14752
|
const finalLogType = resolvedLogType ?? "info";
|
|
14678
14753
|
const emoji = emojiMap[finalLogType] ?? "โน๏ธ";
|
|
@@ -14682,14 +14757,20 @@ function getLogString(messageOrOptions, logType = null, details = null, function
|
|
|
14682
14757
|
if (condense) {
|
|
14683
14758
|
resolvedFileLocation = resolvedFileLocation.split("/").pop();
|
|
14684
14759
|
}
|
|
14685
|
-
|
|
14760
|
+
const ts = padRight(timestamp, COLS.timestamp);
|
|
14761
|
+
const fn = padRight(resolvedFunctionName, COLS.function);
|
|
14762
|
+
const fileName = padLeft(resolvedFileLocation, COLS.file);
|
|
14763
|
+
let line = `${emoji} ` +
|
|
14764
|
+
`[${ts}] ` +
|
|
14765
|
+
`[${fn}] ` +
|
|
14766
|
+
`${message}`;
|
|
14686
14767
|
// ---------------- Details serialization ----------------
|
|
14687
14768
|
if (showDetails && resolvedDetails !== null && resolvedDetails !== undefined) {
|
|
14688
14769
|
const LOG_CONFIG = getLogConfig();
|
|
14689
14770
|
const serialized = serializeDetails(resolvedDetails, condense, LOG_CONFIG.maxDetailsLength);
|
|
14690
14771
|
line += ` | ${serialized}`;
|
|
14691
14772
|
}
|
|
14692
|
-
line += ` | ${
|
|
14773
|
+
line += ` | ${fileName}`;
|
|
14693
14774
|
// ---------------- Browser ----------------
|
|
14694
14775
|
if (IS_BROWSER) {
|
|
14695
14776
|
console[finalLogType === "error"
|