@putkoff/abstract-logger 0.0.50 → 0.0.57

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.
@@ -2,6 +2,10 @@ export declare function getLogConfig(): {
2
2
  condensed: boolean;
3
3
  expandOnDebug: boolean;
4
4
  showDetails: boolean;
5
+ showOnly: boolean;
6
+ showOnlyFunctions: string[];
7
+ showOnlyActivities: string[];
8
+ showOnlyTypes: string[];
5
9
  maxDetailsLength: number;
6
10
  sampleRate: number;
7
11
  prettyDetails: boolean;
@@ -0,0 +1,83 @@
1
+ interface LogStringOptions {
2
+ message: string;
3
+ logType?: LogType;
4
+ activity?: string;
5
+ details?: any;
6
+ function_name?: any;
7
+ file_location?: any;
8
+ consumerLogger?: any;
9
+ }
10
+ type LogType = "info" | "warn" | "error" | "debug" | "success" | "processing" | "listening" | "connect" | "prune" | string | null;
11
+
12
+ declare function getLogString(options: LogStringOptions): string;
13
+ declare function getLogString(messageOrOptions: string | LogStringOptions, logType?: LogType, details?: any, function_name?: any, file_location?: any, consumerLogger?: any): string;
14
+
15
+ declare function getLogConfig(): {
16
+ condensed: boolean;
17
+ expandOnDebug: boolean;
18
+ showDetails: boolean;
19
+ showOnly: boolean;
20
+ showOnlyFunctions: string[];
21
+ showOnlyActivities: string[];
22
+ showOnlyTypes: string[];
23
+ maxDetailsLength: number;
24
+ sampleRate: number;
25
+ prettyDetails: boolean;
26
+ activityBlocklist: string[];
27
+ logTypeBlocklist: string[];
28
+ showDetailslist: string[];
29
+ functionAllowlist: string[];
30
+ functionBlocklist: string[];
31
+ };
32
+ declare function debugLogConfig(): void;
33
+
34
+ declare function padRight(str: string, width: number): string;
35
+ declare function padLeft(str: string, width: number): string;
36
+ /**
37
+ * Normalizes inputs by treating "unknown" and empty values as null.
38
+ * Returns "unknown" ONLY if all inputs are invalid.
39
+ */
40
+ declare function resolveValue<T = string>(...values: Array<T | string | null | undefined>): T | "unknown";
41
+ declare function parseList(value?: string): string[];
42
+
43
+ /** ---------------------------------------------------------
44
+ * Detect Environment
45
+ * --------------------------------------------------------- */
46
+ declare const IS_BROWSER: boolean;
47
+ declare const IS_NODE: boolean;
48
+ declare function extractFile(frame: string): string;
49
+ declare function getCallerInfo(func: any): {
50
+ functionName: any;
51
+ file: string;
52
+ };
53
+
54
+ declare const activityEmojiMap: Record<string, string>;
55
+ declare const COLS: {
56
+ emoji: number;
57
+ timestamp: number;
58
+ function: number;
59
+ message: number;
60
+ file: number;
61
+ };
62
+
63
+ declare function resolveLogger(candidate: any): any;
64
+ declare function shouldCondense(logType: LogType): boolean;
65
+ declare function shouldShowDetails(logType: LogType): boolean;
66
+ declare function serializeDetails(value: any, condensed: boolean, maxLength: number, pretty: boolean): string;
67
+ declare function formatLogLine({ emoji, timestamp, functionName, message, details, file, condense, maxDetailsLength, pretty }: {
68
+ emoji: string;
69
+ timestamp: string;
70
+ functionName: string;
71
+ message: string;
72
+ details?: any;
73
+ file: string;
74
+ condense: boolean;
75
+ maxDetailsLength: number;
76
+ pretty: boolean;
77
+ }): string;
78
+
79
+ declare function getNodeLogger(): any;
80
+ declare const logger: any;
81
+ declare function getFinalLine(line: any, finalLogType: any, resolvedLoggerInput: any): any;
82
+
83
+ export { COLS, IS_BROWSER, IS_NODE, activityEmojiMap, debugLogConfig, extractFile, formatLogLine, getCallerInfo, getFinalLine, getLogConfig, getLogString, getNodeLogger, logger, padLeft, padRight, parseList, resolveLogger, resolveValue, serializeDetails, shouldCondense, shouldShowDetails };
@@ -2,6 +2,10 @@ export declare function getLogConfig(): {
2
2
  condensed: boolean;
3
3
  expandOnDebug: boolean;
4
4
  showDetails: boolean;
5
+ showOnly: boolean;
6
+ showOnlyFunctions: string[];
7
+ showOnlyActivities: string[];
8
+ showOnlyTypes: string[];
5
9
  maxDetailsLength: number;
6
10
  sampleRate: number;
7
11
  prettyDetails: boolean;
@@ -1,79 +1,3 @@
1
- interface LogStringOptions {
2
- message: string;
3
- logType?: LogType;
4
- activity?: string;
5
- details?: any;
6
- function_name?: any;
7
- file_location?: any;
8
- consumerLogger?: any;
9
- }
10
- type LogType = "info" | "warn" | "error" | "debug" | "success" | "processing" | "listening" | "connect" | "prune" | string | null;
11
-
12
- declare function getLogString(options: LogStringOptions): string;
13
- declare function getLogString(messageOrOptions: string | LogStringOptions, logType?: LogType, details?: any, function_name?: any, file_location?: any, consumerLogger?: any): string;
14
-
15
- declare function getLogConfig(): {
16
- condensed: boolean;
17
- expandOnDebug: boolean;
18
- showDetails: boolean;
19
- maxDetailsLength: number;
20
- sampleRate: number;
21
- prettyDetails: boolean;
22
- activityBlocklist: string[];
23
- logTypeBlocklist: string[];
24
- showDetailslist: string[];
25
- functionAllowlist: string[];
26
- functionBlocklist: string[];
27
- };
28
- declare function debugLogConfig(): void;
29
-
30
- declare function padRight(str: string, width: number): string;
31
- declare function padLeft(str: string, width: number): string;
32
- /**
33
- * Normalizes inputs by treating "unknown" and empty values as null.
34
- * Returns "unknown" ONLY if all inputs are invalid.
35
- */
36
- declare function resolveValue<T = string>(...values: Array<T | string | null | undefined>): T | "unknown";
37
- declare function parseList(value?: string): string[];
38
-
39
- /** ---------------------------------------------------------
40
- * Detect Environment
41
- * --------------------------------------------------------- */
42
- declare const IS_BROWSER: boolean;
43
- declare const IS_NODE: boolean;
44
- declare function extractFile(frame: string): string;
45
- declare function getCallerInfo(func: any): {
46
- functionName: any;
47
- file: string;
48
- };
49
-
50
- declare const activityEmojiMap: Record<string, string>;
51
- declare const COLS: {
52
- emoji: number;
53
- timestamp: number;
54
- function: number;
55
- message: number;
56
- file: number;
57
- };
58
-
59
- declare function resolveLogger(candidate: any): any;
60
- declare function shouldCondense(logType: LogType): boolean;
61
- declare function shouldShowDetails(logType: LogType): boolean;
62
- declare function serializeDetails(value: any, condensed: boolean, maxLength: number, pretty: boolean): string;
63
- declare function formatLogLine({ emoji, timestamp, functionName, message, details, file, condense, maxDetailsLength, pretty }: {
64
- emoji: string;
65
- timestamp: string;
66
- functionName: string;
67
- message: string;
68
- details?: any;
69
- file: string;
70
- condense: boolean;
71
- maxDetailsLength: number;
72
- pretty: boolean;
73
- }): string;
74
-
75
- declare function getNodeLogger(): any;
76
- declare const logger: any;
77
- declare function getFinalLine(line: any, finalLogType: any, resolvedLoggerInput: any): any;
78
-
79
- export { COLS, IS_BROWSER, IS_NODE, activityEmojiMap, debugLogConfig, extractFile, formatLogLine, getCallerInfo, getFinalLine, getLogConfig, getLogString, getNodeLogger, logger, padLeft, padRight, parseList, resolveLogger, resolveValue, serializeDetails, shouldCondense, shouldShowDetails };
1
+ export * from './logger';
2
+ export * from './config';
3
+ export * from './imports';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putkoff/abstract-logger",
3
- "version": "0.0.50",
3
+ "version": "0.0.57",
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",