@putkoff/abstract-logger 0.0.34 → 0.0.37

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.
Files changed (47) hide show
  1. package/dist/cjs/index.js +373 -259
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/types/config.d.ts +4 -0
  4. package/dist/cjs/types/imports/constants.d.ts +8 -0
  5. package/dist/cjs/types/imports/functions.d.ts +16 -0
  6. package/dist/cjs/types/imports/index.d.ts +5 -0
  7. package/dist/cjs/types/imports/init_imports.d.ts +1 -0
  8. package/dist/cjs/types/imports/nodeLogger.d.ts +3 -0
  9. package/dist/cjs/types/imports/utils/detect.d.ts +10 -0
  10. package/dist/cjs/types/imports/utils/index.d.ts +2 -0
  11. package/dist/cjs/types/imports/utils/utils.d.ts +8 -0
  12. package/dist/cjs/types/index.d.ts +1 -1
  13. package/dist/cjs/types/logger/blocker.d.ts +4 -0
  14. package/dist/cjs/types/logger/logger.d.ts +1 -18
  15. package/dist/cjs/types/types/index.d.ts +1 -0
  16. package/dist/cjs/types/types/types.d.ts +10 -0
  17. package/dist/esm/index.js +361 -260
  18. package/dist/esm/index.js.map +1 -1
  19. package/dist/esm/types/config.d.ts +4 -0
  20. package/dist/esm/types/imports/constants.d.ts +8 -0
  21. package/dist/esm/types/imports/functions.d.ts +16 -0
  22. package/dist/esm/types/imports/index.d.ts +5 -0
  23. package/dist/esm/types/imports/init_imports.d.ts +1 -0
  24. package/dist/esm/types/imports/nodeLogger.d.ts +3 -0
  25. package/dist/esm/types/imports/utils/detect.d.ts +10 -0
  26. package/dist/esm/types/imports/utils/index.d.ts +2 -0
  27. package/dist/esm/types/imports/utils/utils.d.ts +8 -0
  28. package/dist/esm/types/index.d.ts +1 -1
  29. package/dist/esm/types/logger/blocker.d.ts +4 -0
  30. package/dist/esm/types/logger/logger.d.ts +1 -18
  31. package/dist/esm/types/types/index.d.ts +1 -0
  32. package/dist/esm/types/types/types.d.ts +10 -0
  33. package/dist/types/config.d.ts +4 -0
  34. package/dist/types/imports/constants.d.ts +8 -0
  35. package/dist/types/imports/functions.d.ts +16 -0
  36. package/dist/types/imports/index.d.ts +5 -0
  37. package/dist/types/imports/init_imports.d.ts +1 -0
  38. package/dist/types/imports/nodeLogger.d.ts +3 -0
  39. package/dist/types/imports/utils/detect.d.ts +10 -0
  40. package/dist/types/imports/utils/index.d.ts +2 -0
  41. package/dist/types/imports/utils/utils.d.ts +8 -0
  42. package/dist/types/index.d.ts +51 -11
  43. package/dist/types/logger/blocker.d.ts +4 -0
  44. package/dist/types/logger/logger.d.ts +1 -18
  45. package/dist/types/types/index.d.ts +1 -0
  46. package/dist/types/types/types.d.ts +10 -0
  47. package/package.json +1 -1
@@ -3,6 +3,10 @@ export declare function getLogConfig(): {
3
3
  expandOnDebug: boolean;
4
4
  showDetails: boolean;
5
5
  maxDetailsLength: number;
6
+ activityBlocklist: string[];
7
+ logTypeBlocklist: string[];
8
+ sampleRate: number;
9
+ prettyDetails: boolean;
6
10
  showDetailslist: string[];
7
11
  functionAllowlist: string[];
8
12
  functionBlocklist: string[];
@@ -0,0 +1,8 @@
1
+ export declare const activityEmojiMap: Record<string, string>;
2
+ export declare const COLS: {
3
+ emoji: number;
4
+ timestamp: number;
5
+ function: number;
6
+ message: number;
7
+ file: number;
8
+ };
@@ -0,0 +1,16 @@
1
+ import type { LogType } from './../types/index';
2
+ export declare function resolveLogger(candidate: any): any;
3
+ export declare function shouldCondense(logType: LogType): boolean;
4
+ export declare function shouldShowDetails(logType: LogType): boolean;
5
+ export declare function serializeDetails(value: any, condensed: boolean, maxLength: number, pretty: boolean): string;
6
+ export declare function formatLogLine({ emoji, timestamp, functionName, message, details, file, condense, maxDetailsLength, pretty }: {
7
+ emoji: string;
8
+ timestamp: string;
9
+ functionName: string;
10
+ message: string;
11
+ details?: any;
12
+ file: string;
13
+ condense: boolean;
14
+ maxDetailsLength: number;
15
+ pretty: boolean;
16
+ }): string;
@@ -0,0 +1,5 @@
1
+ export * from './utils';
2
+ export * from './constants';
3
+ export * from './functions';
4
+ export * from './index';
5
+ export * from './nodeLogger';
@@ -0,0 +1 @@
1
+ export { createLogger, format, transports } from "winston";
@@ -0,0 +1,3 @@
1
+ export declare function getNodeLogger(): any;
2
+ export declare const logger: any;
3
+ export declare function getFinalLine(line: any, finalLogType: any, resolvedLoggerInput: any): any;
@@ -0,0 +1,10 @@
1
+ /** ---------------------------------------------------------
2
+ * Detect Environment
3
+ * --------------------------------------------------------- */
4
+ export declare const IS_BROWSER: boolean;
5
+ export declare const IS_NODE: boolean;
6
+ export declare function extractFile(frame: string): string;
7
+ export declare function getCallerInfo(func: any): {
8
+ functionName: any;
9
+ file: string;
10
+ };
@@ -0,0 +1,2 @@
1
+ export * from './utils';
2
+ export * from './detect';
@@ -0,0 +1,8 @@
1
+ export declare function padRight(str: string, width: number): string;
2
+ export declare function padLeft(str: string, width: number): string;
3
+ /**
4
+ * Normalizes inputs by treating "unknown" and empty values as null.
5
+ * Returns "unknown" ONLY if all inputs are invalid.
6
+ */
7
+ export declare function resolveValue<T = string>(...values: Array<T | string | null | undefined>): T | "unknown";
8
+ export declare function parseList(value?: string): string[];
@@ -1,3 +1,3 @@
1
1
  export * from './logger';
2
2
  export * from './config';
3
- export * from './detect';
3
+ export * from './imports';
@@ -0,0 +1,4 @@
1
+ import type { LogStringOptions } from "../types";
2
+ export declare function shouldLog(opts: LogStringOptions, caller: {
3
+ functionName: string;
4
+ }): boolean;
@@ -1,20 +1,3 @@
1
- import "dotenv/config";
2
- export type LogType = "success" | "processing" | "listening" | "computing" | "waiting" | "emitting" | "ingesting" | "prune" | "connect" | "info" | "warn" | "error" | "debug" | null;
3
- /** Exported logger */
4
- export declare const logger: any;
5
- /**
6
- * Normalizes inputs by treating "unknown" and empty values as null.
7
- * Returns "unknown" ONLY if all inputs are invalid.
8
- */
9
- export declare function resolveValue<T = string>(...values: Array<T | string | null | undefined>): T | "unknown";
10
- export interface LogStringOptions {
11
- message: string;
12
- logType?: LogType;
13
- details?: any;
14
- function_name?: any;
15
- file_location?: any;
16
- consumerLogger?: any;
17
- }
18
- export declare function serializeDetails(value: any, condensed: boolean, maxLength: number): string;
1
+ import type { LogStringOptions, LogType } from './../types';
19
2
  export declare function getLogString(options: LogStringOptions): string;
20
3
  export declare function getLogString(messageOrOptions: string | LogStringOptions, logType?: LogType, details?: any, function_name?: any, file_location?: any, consumerLogger?: any): string;
@@ -0,0 +1 @@
1
+ export * from './types';
@@ -0,0 +1,10 @@
1
+ export 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
+ export type LogType = "info" | "warn" | "error" | "debug" | "success" | "processing" | "listening" | "connect" | "prune" | string | null;