@bernierllc/logging-utils 0.1.0
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/LICENSE +7 -0
- package/README.md +261 -0
- package/dist/aggregation.d.ts +85 -0
- package/dist/aggregation.js +172 -0
- package/dist/analysis.d.ts +87 -0
- package/dist/analysis.js +204 -0
- package/dist/formatters.d.ts +55 -0
- package/dist/formatters.js +195 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +28 -0
- package/dist/performance.d.ts +67 -0
- package/dist/performance.js +149 -0
- package/dist/types.d.ts +47 -0
- package/dist/types.js +9 -0
- package/package.json +48 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Log levels supported by the logging system
|
|
3
|
+
*/
|
|
4
|
+
export type LogLevel = 'error' | 'warn' | 'info' | 'debug';
|
|
5
|
+
/**
|
|
6
|
+
* Base log entry interface
|
|
7
|
+
*/
|
|
8
|
+
export interface LogEntry {
|
|
9
|
+
level: LogLevel;
|
|
10
|
+
message: string;
|
|
11
|
+
timestamp: string;
|
|
12
|
+
metadata?: Record<string, unknown>;
|
|
13
|
+
context?: string;
|
|
14
|
+
requestId?: string;
|
|
15
|
+
userId?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Audit log entry interface
|
|
19
|
+
*/
|
|
20
|
+
export interface AuditLogEntry {
|
|
21
|
+
actorId: string;
|
|
22
|
+
action: string;
|
|
23
|
+
target: string;
|
|
24
|
+
ip?: string;
|
|
25
|
+
metadata?: Record<string, unknown>;
|
|
26
|
+
timestamp?: string;
|
|
27
|
+
userId?: string;
|
|
28
|
+
sessionId?: string;
|
|
29
|
+
userAgent?: string;
|
|
30
|
+
requestId?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* System log entry interface
|
|
34
|
+
*/
|
|
35
|
+
export interface SystemLogEntry extends LogEntry {
|
|
36
|
+
error?: Error;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Performance metrics interface
|
|
40
|
+
*/
|
|
41
|
+
export interface PerformanceMetrics {
|
|
42
|
+
duration: number;
|
|
43
|
+
memoryUsage?: number;
|
|
44
|
+
cpuUsage?: number;
|
|
45
|
+
requestCount?: number;
|
|
46
|
+
errorCount?: number;
|
|
47
|
+
}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Copyright (c) 2025 Bernier LLC
|
|
4
|
+
|
|
5
|
+
This file is licensed to the client under a limited-use license.
|
|
6
|
+
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
7
|
+
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bernierllc/logging-utils",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Utility functions for log analysis, performance monitoring, and format conversion",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"README.md",
|
|
10
|
+
"LICENSE"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"test": "jest",
|
|
14
|
+
"build": "tsc --outDir ./dist --rootDir ./src --target es2020 --module commonjs --declaration --esModuleInterop --skipLibCheck src/index.ts src/types.ts src/performance.ts src/analysis.ts src/aggregation.ts src/formatters.ts",
|
|
15
|
+
"dev": "tsc --watch",
|
|
16
|
+
"lint": "eslint src/**/*.ts",
|
|
17
|
+
"format": "prettier --write src/**/*.ts"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"logging",
|
|
21
|
+
"utilities",
|
|
22
|
+
"performance",
|
|
23
|
+
"analysis",
|
|
24
|
+
"monitoring",
|
|
25
|
+
"typescript"
|
|
26
|
+
],
|
|
27
|
+
"author": "Bernier LLC",
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "https://github.com/bernier-llc/tools"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@bernierllc/logging-core": "^0.1.0"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@types/node": "^20.0.0",
|
|
38
|
+
"@types/jest": "^29.5.14",
|
|
39
|
+
"typescript": "^5.0.0",
|
|
40
|
+
"jest": "^29.5.0",
|
|
41
|
+
"ts-jest": "^29.4.0",
|
|
42
|
+
"eslint": "^8.0.0",
|
|
43
|
+
"prettier": "^3.0.0"
|
|
44
|
+
},
|
|
45
|
+
"engines": {
|
|
46
|
+
"node": ">=18.0.0"
|
|
47
|
+
}
|
|
48
|
+
}
|