@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 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
- let line = `${emoji} [${timestamp}] [${resolvedFunctionName}] ${message}`;
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 += ` | ${resolvedFileLocation}`;
14773
+ line += ` | ${fileName}`;
14693
14774
  // ---------------- Browser ----------------
14694
14775
  if (IS_BROWSER) {
14695
14776
  console[finalLogType === "error"