@putkoff/abstract-logger 0.0.68 → 0.0.74

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,10 +1,15 @@
1
+ import type { LogStringOptions } from './../../types/index.js';
1
2
  /** ---------------------------------------------------------
2
3
  * Detect Environment
3
4
  * --------------------------------------------------------- */
4
5
  export declare const IS_BROWSER: boolean;
5
6
  export declare const IS_NODE: boolean;
6
7
  export declare function extractFile(frame: string): string;
7
- export declare function getCallerInfo(func: any): {
8
+ export declare function getCallerInfo(skipExternal?: number): {
8
9
  functionName: any;
9
10
  file: string;
10
11
  };
12
+ export declare function getCheapCallerHint(opts: LogStringOptions): {
13
+ functionName: any;
14
+ file: any;
15
+ };
@@ -1,2 +1,3 @@
1
1
  export * from './utils.js';
2
2
  export * from './detect.js';
3
+ export * from './loggerModes.js';
@@ -0,0 +1,28 @@
1
+ export declare enum LogMode {
2
+ FULL = "full",// abstract-logger (format + winston)
3
+ CONSOLE = "console",// console.log only
4
+ COUNT = "count",// count + timing, no output
5
+ OFF = "off"
6
+ }
7
+ export interface LogStats {
8
+ calls: number;
9
+ totalNs: bigint;
10
+ }
11
+ export type CounterMap = Record<string, number>;
12
+ export declare const LATENCY_BUCKETS: bigint[];
13
+ export declare const stats: {
14
+ calls: number;
15
+ totalNs: bigint;
16
+ byMode: CounterMap;
17
+ byType: CounterMap;
18
+ byFunction: CounterMap;
19
+ latency: {
20
+ buckets: number[];
21
+ counts: any[];
22
+ };
23
+ };
24
+ export declare function inc(map: CounterMap, key?: string | null): void;
25
+ export declare function recordLatency(ns: bigint): void;
26
+ export declare function setLogMode(next: LogMode): void;
27
+ export declare function lockLogMode(): void;
28
+ export declare function getLogMode(): LogMode;
@@ -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;
@@ -1,4 +1,3 @@
1
- export * from './loggerModes.js';
2
1
  export * from './loggerBenchRecorder.js';
3
2
  export * from './loggerBench.js';
4
3
  export * from './logger.js';
@@ -1,18 +1,9 @@
1
- import { LogMode } from "./loggerModes.js";
2
- export interface LogStats {
3
- calls: number;
4
- totalNs: bigint;
5
- }
6
- type CounterMap = Record<string, number>;
7
- export declare function setLogMode(next: LogMode): void;
8
- export declare function lockLogMode(): void;
9
- export declare function getLogMode(): LogMode;
10
1
  export declare function getLogStats(): {
11
2
  calls: number;
12
3
  avgNs: number;
13
- byMode: CounterMap;
14
- byType: CounterMap;
15
- byFunction: CounterMap;
4
+ byMode: import("./../../imports/index.js").CounterMap;
5
+ byType: import("./../../imports/index.js").CounterMap;
6
+ byFunction: import("./../../imports/index.js").CounterMap;
16
7
  latency: {
17
8
  buckets: number[];
18
9
  counts: any[];
@@ -21,4 +12,3 @@ export declare function getLogStats(): {
21
12
  export declare function resetLogStats(): void;
22
13
  export declare function logEvent(props: any): void;
23
14
  export declare function setLogs(mode?: number | null, interval?: boolean, window_ms?: any): void;
24
- export {};
@@ -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;
@@ -1,10 +1,15 @@
1
+ import type { LogStringOptions } from './../../types/index.js';
1
2
  /** ---------------------------------------------------------
2
3
  * Detect Environment
3
4
  * --------------------------------------------------------- */
4
5
  export declare const IS_BROWSER: boolean;
5
6
  export declare const IS_NODE: boolean;
6
7
  export declare function extractFile(frame: string): string;
7
- export declare function getCallerInfo(func: any): {
8
+ export declare function getCallerInfo(skipExternal?: number): {
8
9
  functionName: any;
9
10
  file: string;
10
11
  };
12
+ export declare function getCheapCallerHint(opts: LogStringOptions): {
13
+ functionName: any;
14
+ file: any;
15
+ };
@@ -1,2 +1,3 @@
1
1
  export * from './utils.js';
2
2
  export * from './detect.js';
3
+ export * from './loggerModes.js';
@@ -0,0 +1,28 @@
1
+ export declare enum LogMode {
2
+ FULL = "full",// abstract-logger (format + winston)
3
+ CONSOLE = "console",// console.log only
4
+ COUNT = "count",// count + timing, no output
5
+ OFF = "off"
6
+ }
7
+ export interface LogStats {
8
+ calls: number;
9
+ totalNs: bigint;
10
+ }
11
+ export type CounterMap = Record<string, number>;
12
+ export declare const LATENCY_BUCKETS: bigint[];
13
+ export declare const stats: {
14
+ calls: number;
15
+ totalNs: bigint;
16
+ byMode: CounterMap;
17
+ byType: CounterMap;
18
+ byFunction: CounterMap;
19
+ latency: {
20
+ buckets: number[];
21
+ counts: any[];
22
+ };
23
+ };
24
+ export declare function inc(map: CounterMap, key?: string | null): void;
25
+ export declare function recordLatency(ns: bigint): void;
26
+ export declare function setLogMode(next: LogMode): void;
27
+ export declare function lockLogMode(): void;
28
+ export declare function getLogMode(): LogMode;
@@ -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;
@@ -1,4 +1,3 @@
1
- export * from './loggerModes.js';
2
1
  export * from './loggerBenchRecorder.js';
3
2
  export * from './loggerBench.js';
4
3
  export * from './logger.js';
@@ -1,18 +1,9 @@
1
- import { LogMode } from "./loggerModes.js";
2
- export interface LogStats {
3
- calls: number;
4
- totalNs: bigint;
5
- }
6
- type CounterMap = Record<string, number>;
7
- export declare function setLogMode(next: LogMode): void;
8
- export declare function lockLogMode(): void;
9
- export declare function getLogMode(): LogMode;
10
1
  export declare function getLogStats(): {
11
2
  calls: number;
12
3
  avgNs: number;
13
- byMode: CounterMap;
14
- byType: CounterMap;
15
- byFunction: CounterMap;
4
+ byMode: import("./../../imports/index.js").CounterMap;
5
+ byType: import("./../../imports/index.js").CounterMap;
6
+ byFunction: import("./../../imports/index.js").CounterMap;
16
7
  latency: {
17
8
  buckets: number[];
18
9
  counts: any[];
@@ -21,4 +12,3 @@ export declare function getLogStats(): {
21
12
  export declare function resetLogStats(): void;
22
13
  export declare function logEvent(props: any): void;
23
14
  export declare function setLogs(mode?: number | null, interval?: boolean, window_ms?: any): void;
24
- export {};
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putkoff/abstract-logger",
3
- "version": "0.0.68",
3
+ "version": "0.0.74",
4
4
  "type": "module",
5
5
  "description": "Lightweight TypeScript logger wrapper with auto-context tracing and Winston integration.",
6
6
  "main": "dist/cjs/index.js",