unnbound-logger-sdk 2.0.0 → 2.0.1
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/dist/index.d.ts +0 -28
- package/dist/index.js +1 -16
- package/dist/unnbound-logger.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -8,31 +8,3 @@ import { UnnboundLogger } from './unnbound-logger';
|
|
|
8
8
|
import { LogLevel, LogType, HttpMethod, LoggerOptions, GeneralLogOptions, HttpRequestLogOptions, HttpResponseLogOptions, SftpTransactionLogOptions, DbQueryTransactionLogOptions, Log, LogTransaction, HttpRequestLog, HttpResponseLog, SftpTransactionLog, DbQueryTransactionLog, SerializableError } from './types';
|
|
9
9
|
import { clearTraceId } from './utils/logger-utils';
|
|
10
10
|
export { UnnboundLogger, LogLevel, LogType, HttpMethod, LoggerOptions, GeneralLogOptions, HttpRequestLogOptions, HttpResponseLogOptions, SftpTransactionLogOptions, DbQueryTransactionLogOptions, Log, LogTransaction, HttpRequestLog, HttpResponseLog, SftpTransactionLog, DbQueryTransactionLog, SerializableError, clearTraceId, };
|
|
11
|
-
declare const defaultLogger: UnnboundLogger;
|
|
12
|
-
export { defaultLogger };
|
|
13
|
-
export declare const log: (level: LogLevel, message: string | Error | Record<string, unknown>, options?: GeneralLogOptions) => void;
|
|
14
|
-
export declare const error: (message: string | Error | Record<string, unknown>, options?: GeneralLogOptions) => void;
|
|
15
|
-
export declare const warn: (message: string | Error | Record<string, unknown>, options?: GeneralLogOptions) => void;
|
|
16
|
-
export declare const info: (message: string | Error | Record<string, unknown>, options?: GeneralLogOptions) => void;
|
|
17
|
-
export declare const debug: (message: string | Error | Record<string, unknown>, options?: GeneralLogOptions) => void;
|
|
18
|
-
export declare const httpRequest: (req: import("express").Request, options?: HttpRequestLogOptions) => string;
|
|
19
|
-
export declare const httpResponse: (res: import("express").Response, req: import("express").Request, options?: HttpResponseLogOptions) => void;
|
|
20
|
-
export declare const sftpTransaction: (operation: {
|
|
21
|
-
host: string;
|
|
22
|
-
username: string;
|
|
23
|
-
operation: "upload" | "download" | "list" | "delete" | "rename" | "stat";
|
|
24
|
-
path: string;
|
|
25
|
-
status: "success" | "failure";
|
|
26
|
-
bytesTransferred?: number;
|
|
27
|
-
filesListed?: number;
|
|
28
|
-
sourcePath?: string;
|
|
29
|
-
}, options?: SftpTransactionLogOptions) => void;
|
|
30
|
-
export declare const dbQueryTransaction: (query: {
|
|
31
|
-
instance: string;
|
|
32
|
-
vendor: "postgres" | "mysql" | "mssql" | "mongodb";
|
|
33
|
-
query?: string;
|
|
34
|
-
status: "success" | "failure";
|
|
35
|
-
rowsReturned?: number;
|
|
36
|
-
rowsAffected?: number;
|
|
37
|
-
}, options?: DbQueryTransactionLogOptions) => void;
|
|
38
|
-
export default UnnboundLogger;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.clearTraceId = exports.UnnboundLogger = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* unnbound-logger
|
|
6
6
|
*
|
|
@@ -11,18 +11,3 @@ const unnbound_logger_1 = require("./unnbound-logger");
|
|
|
11
11
|
Object.defineProperty(exports, "UnnboundLogger", { enumerable: true, get: function () { return unnbound_logger_1.UnnboundLogger; } });
|
|
12
12
|
const logger_utils_1 = require("./utils/logger-utils");
|
|
13
13
|
Object.defineProperty(exports, "clearTraceId", { enumerable: true, get: function () { return logger_utils_1.clearTraceId; } });
|
|
14
|
-
// Create a default logger instance
|
|
15
|
-
const defaultLogger = new unnbound_logger_1.UnnboundLogger();
|
|
16
|
-
exports.defaultLogger = defaultLogger;
|
|
17
|
-
// Export default logger functions for convenience
|
|
18
|
-
exports.log = defaultLogger.log.bind(defaultLogger);
|
|
19
|
-
exports.error = defaultLogger.error.bind(defaultLogger);
|
|
20
|
-
exports.warn = defaultLogger.warn.bind(defaultLogger);
|
|
21
|
-
exports.info = defaultLogger.info.bind(defaultLogger);
|
|
22
|
-
exports.debug = defaultLogger.debug.bind(defaultLogger);
|
|
23
|
-
exports.httpRequest = defaultLogger.httpRequest.bind(defaultLogger);
|
|
24
|
-
exports.httpResponse = defaultLogger.httpResponse.bind(defaultLogger);
|
|
25
|
-
exports.sftpTransaction = defaultLogger.sftpTransaction.bind(defaultLogger);
|
|
26
|
-
exports.dbQueryTransaction = defaultLogger.dbQueryTransaction.bind(defaultLogger);
|
|
27
|
-
// Default export is the UnnboundLogger class
|
|
28
|
-
exports.default = unnbound_logger_1.UnnboundLogger;
|
package/dist/unnbound-logger.js
CHANGED
|
@@ -182,7 +182,7 @@ class UnnboundLogger {
|
|
|
182
182
|
...(this.serviceName && { service: this.serviceName }),
|
|
183
183
|
...(this.environment && { environment: this.environment }),
|
|
184
184
|
},
|
|
185
|
-
timestamp:
|
|
185
|
+
timestamp: false, // Let CloudWatch handle timestamps
|
|
186
186
|
formatters: {
|
|
187
187
|
level: (label) => {
|
|
188
188
|
return { level: label };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unnbound-logger-sdk",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "A structured logging library with TypeScript support using Pino. Provides consistent, well-typed logging across different operational contexts with automatic trace ID propagation.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|