@putkoff/abstract-logger 0.0.15 → 0.0.16

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
@@ -14528,17 +14528,20 @@ function resolveLogger(candidate) {
14528
14528
  /* ------------------------------------------------------------------ */
14529
14529
  /* UNIVERSAL getLogString (cannot crash) */
14530
14530
  /* ------------------------------------------------------------------ */
14531
- function getLogString(message, details = null, logType = "info", consumerLogger = null) {
14532
- const { functionName, file } = getCallerInfo();
14531
+ function getLogString(message, logType = null, details = null, function_name = null, file_location = null, consumerLogger = null) {
14532
+ let { functionName, file } = getCallerInfo();
14533
+ function_name = functionName || function_name;
14534
+ file_location = file || file_location;
14533
14535
  const emojiMap = {
14534
14536
  info: "ℹ️",
14535
14537
  warn: "⚠️",
14536
14538
  error: "❌",
14537
14539
  debug: "🔍",
14538
14540
  };
14541
+ logType = logType || "info";
14539
14542
  const emoji = emojiMap[logType] ?? "ℹ️";
14540
14543
  const timestamp = new Date().toISOString();
14541
- let line = `${emoji} [${timestamp}] [${functionName}] ${message} | ${file}`;
14544
+ let line = `${emoji} [${timestamp}] [${function_name}] ${message} | ${file_location}`;
14542
14545
  if (details !== null && details !== undefined) {
14543
14546
  try {
14544
14547
  const seen = new WeakSet();