@putkoff/abstract-logger 0.0.73 → 0.0.75

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.
@@ -1,3 +1,3 @@
1
1
  import type { LogStringOptions, LogType } from './../../types/index.js';
2
2
  export declare function logit(options: LogStringOptions): string;
3
- export declare function logit(messageOrOptions: string | LogStringOptions, logType?: LogType, details?: any, function_name?: any, file_location?: any, consumerLogger?: any): string;
3
+ export declare function logit(messageOrOptions: string | LogStringOptions, logType?: LogType, details?: any, function_name?: any, file_location?: any, consumerLogger?: any, skip?: any): string;
@@ -6,5 +6,6 @@ export interface LogStringOptions {
6
6
  function_name?: any;
7
7
  file_location?: any;
8
8
  consumerLogger?: any;
9
+ skip?: number;
9
10
  }
10
11
  export type LogType = "info" | "warn" | "error" | "debug" | "success" | "processing" | "listening" | "connect" | "prune" | string | null;
package/dist/esm/index.js CHANGED
@@ -15012,7 +15012,7 @@ function getCheapCallerHint(opts) {
15012
15012
  file: opts.file_location ?? null,
15013
15013
  };
15014
15014
  }
15015
- function logit(messageOrOptions, logType = null, details = null, function_name = null, file_location = null, consumerLogger = null) {
15015
+ function logit(messageOrOptions, logType = null, details = null, function_name = null, file_location = null, consumerLogger = null, skip = null) {
15016
15016
  /* -------------------------------------------------- */
15017
15017
  /* Normalize inputs */
15018
15018
  /* -------------------------------------------------- */
@@ -15025,6 +15025,7 @@ function logit(messageOrOptions, logType = null, details = null, function_name =
15025
15025
  function_name,
15026
15026
  file_location,
15027
15027
  consumerLogger,
15028
+ skip
15028
15029
  };
15029
15030
  let { message, logType: resolvedLogType, details: resolvedDetails, function_name: resolvedFunctionName, file_location: resolvedFileLocation, consumerLogger: resolvedLoggerInput, } = opts;
15030
15031
  /* -------------------------------------------------- */
@@ -15038,8 +15039,10 @@ function logit(messageOrOptions, logType = null, details = null, function_name =
15038
15039
  return "";
15039
15040
  }
15040
15041
  // 🔹 Phase 2: expensive caller inspection (ONLY NOW)
15041
- const caller = getCallerInfo();
15042
- // 🔹 Phase 3: finalize names
15042
+ const skipExternal = typeof opts.skip === "number" && opts.skip >= 0
15043
+ ? opts.skip
15044
+ : 0;
15045
+ const caller = getCallerInfo(skipExternal);
15043
15046
  resolvedFunctionName = resolveValue(resolvedFunctionName, caller.functionName);
15044
15047
  resolvedFileLocation = resolveValue(resolvedFileLocation, caller.file);
15045
15048
  /* -------------------------------------------------- */