azify-logger 1.0.8 → 1.0.9
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.
- package/index.d.ts +86 -0
- package/package.json +3 -1
package/index.d.ts
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AzifyLogger class for structured logging with OpenTelemetry integration
|
|
3
|
+
*/
|
|
4
|
+
export class AzifyLogger {
|
|
5
|
+
/**
|
|
6
|
+
* Creates an instance of AzifyLogger
|
|
7
|
+
* @param options - Configuration options
|
|
8
|
+
*/
|
|
9
|
+
constructor(options?: {
|
|
10
|
+
serviceName?: string;
|
|
11
|
+
loggerUrl?: string;
|
|
12
|
+
environment?: string;
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Sends a log entry to the azify-logger service
|
|
17
|
+
* @param level - Log level (info, error, warn, debug)
|
|
18
|
+
* @param message - Log message
|
|
19
|
+
* @param meta - Additional metadata to include in the log
|
|
20
|
+
*/
|
|
21
|
+
log(level: string, message: string, meta?: Record<string, any>): Promise<void>;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Logs an info level message
|
|
25
|
+
* @param message - Log message
|
|
26
|
+
* @param meta - Additional metadata
|
|
27
|
+
*/
|
|
28
|
+
info(message: string, meta?: Record<string, any>): Promise<void>;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Logs an error level message with optional error object
|
|
32
|
+
* @param message - Log message
|
|
33
|
+
* @param error - Error object to include in metadata
|
|
34
|
+
* @param meta - Additional metadata
|
|
35
|
+
*/
|
|
36
|
+
error(message: string, error?: Error | null, meta?: Record<string, any>): Promise<void>;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Logs a warning level message
|
|
40
|
+
* @param message - Log message
|
|
41
|
+
* @param meta - Additional metadata
|
|
42
|
+
*/
|
|
43
|
+
warn(message: string, meta?: Record<string, any>): Promise<void>;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Logs a debug level message
|
|
47
|
+
* @param message - Log message
|
|
48
|
+
* @param meta - Additional metadata
|
|
49
|
+
*/
|
|
50
|
+
debug(message: string, meta?: Record<string, any>): Promise<void>;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Creates a new AzifyLogger instance with custom options
|
|
55
|
+
* @param options - Configuration options
|
|
56
|
+
* @returns New AzifyLogger instance
|
|
57
|
+
*/
|
|
58
|
+
export function createAzifyLogger(options?: {
|
|
59
|
+
serviceName?: string;
|
|
60
|
+
loggerUrl?: string;
|
|
61
|
+
environment?: string;
|
|
62
|
+
}): AzifyLogger;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Creates a new AzifyLogger instance using environment variables
|
|
66
|
+
* @returns New AzifyLogger instance configured from environment
|
|
67
|
+
*/
|
|
68
|
+
export function createAzifyLoggerFromEnv(): AzifyLogger;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Streams for different logging libraries
|
|
72
|
+
*/
|
|
73
|
+
export const streams: {
|
|
74
|
+
createBunyanStream: any;
|
|
75
|
+
createPinoStream: any;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Middleware for different frameworks
|
|
80
|
+
*/
|
|
81
|
+
export const middleware: {
|
|
82
|
+
restify: any;
|
|
83
|
+
express: () => any;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export default AzifyLogger;
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "azify-logger",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "Azify Logger Client - Centralized logging for OpenSearch",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"types": "index.d.ts",
|
|
6
7
|
"type": "commonjs",
|
|
7
8
|
"scripts": {
|
|
8
9
|
"test": "echo \"No tests specified\" && exit 0",
|
|
@@ -47,6 +48,7 @@
|
|
|
47
48
|
},
|
|
48
49
|
"files": [
|
|
49
50
|
"index.js",
|
|
51
|
+
"index.d.ts",
|
|
50
52
|
"store.js",
|
|
51
53
|
"register-otel.js",
|
|
52
54
|
"register-restify.js",
|