reggolxc 2.0.6 → 2.0.7

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.
@@ -0,0 +1,44 @@
1
+ export declare const LEVELS_ENUM: {
2
+ readonly DEBUG: 'debug';
3
+ readonly INFO: 'info';
4
+ readonly WARN: 'warn';
5
+ readonly ERROR: 'error';
6
+ readonly FATAL: 'fatal';
7
+ };
8
+ export type LogLevel = typeof LEVELS_ENUM[keyof typeof LEVELS_ENUM];
9
+ export interface LogPayload {
10
+ level: LogLevel;
11
+ timestamp: string;
12
+ message: string;
13
+ args: any[];
14
+ }
15
+ export type FetchTransportFn = (payload: LogPayload) => Promise<unknown>;
16
+ export declare class Transport {
17
+ minLevelValue: number;
18
+ constructor(minLevelValue?: number);
19
+ handle(levelName: LogLevel, levelValue: number, payload: LogPayload): void;
20
+ }
21
+ export declare class ConsoleTransport extends Transport {
22
+ constructor(minLevel?: LogLevel);
23
+ handle(levelName: LogLevel, levelValue: number, payload: LogPayload): void;
24
+ }
25
+ export declare class TelemetryTransport extends Transport {
26
+ private fetchFun;
27
+ constructor(fetchFun: FetchTransportFn, minLevel?: LogLevel);
28
+ handle(levelName: LogLevel, levelValue: number, payload: LogPayload): void;
29
+ }
30
+ /**
31
+ * @description Custom logger
32
+ */
33
+ export declare class Roggel {
34
+ private transports;
35
+ constructor(transports?: Transport | Transport[]);
36
+ addTransport(transport: Transport | Transport[]): void;
37
+ getTransports(): Transport[];
38
+ private processLog;
39
+ debug(message: string, ...args: any[]): void;
40
+ info(message: string, ...args: any[]): void;
41
+ warn(message: string, ...args: any[]): void;
42
+ error(message: string, ...args: any[]): void;
43
+ fatal(message: string, ...args: any[]): void;
44
+ }
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reggolxc",
3
- "version": "2.0.6",
3
+ "version": "2.0.7",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./dist/console.js",
package/tsconfig.json CHANGED
@@ -49,7 +49,7 @@
49
49
  // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
50
50
 
51
51
  /* Emit */
52
- // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
52
+ "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
53
53
  // "declarationMap": true, /* Create sourcemaps for d.ts files. */
54
54
  // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
55
55
  // "sourceMap": true, /* Create source map files for emitted JavaScript files. */