atabey-shared 0.1.2 → 0.1.4
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/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Atabey Shared — Local AI Control Plane & Discipline Layer (Shared Utilities)
|
|
2
2
|
|
|
3
|
-
[](https://github.com/ysf-bkr/atabey)
|
|
4
4
|
[](https://www.npmjs.com/package/atabey-shared)
|
|
5
5
|
[](https://www.gnu.org/licenses/agpl-3.0)
|
|
6
6
|
|
|
@@ -14,11 +14,11 @@ export interface LoggerConfig {
|
|
|
14
14
|
piiWarning: boolean;
|
|
15
15
|
useStderr?: boolean;
|
|
16
16
|
}
|
|
17
|
-
export declare class
|
|
17
|
+
export declare class StructuredLogger {
|
|
18
18
|
private config;
|
|
19
19
|
private static instance;
|
|
20
20
|
private constructor();
|
|
21
|
-
static getInstance():
|
|
21
|
+
static getInstance(): StructuredLogger;
|
|
22
22
|
configure(config: Partial<LoggerConfig>): void;
|
|
23
23
|
private formatMessage;
|
|
24
24
|
private log;
|
|
@@ -28,4 +28,4 @@ export declare class EnterpriseLogger {
|
|
|
28
28
|
error(message: string, meta?: unknown): void;
|
|
29
29
|
fatal(message: string, meta?: unknown): void;
|
|
30
30
|
}
|
|
31
|
-
export declare const logger:
|
|
31
|
+
export declare const logger: StructuredLogger;
|
|
@@ -31,7 +31,7 @@ export var LogLevel;
|
|
|
31
31
|
LogLevel[LogLevel["ERROR"] = 3] = "ERROR";
|
|
32
32
|
LogLevel[LogLevel["FATAL"] = 4] = "FATAL";
|
|
33
33
|
})(LogLevel || (LogLevel = {}));
|
|
34
|
-
export class
|
|
34
|
+
export class StructuredLogger {
|
|
35
35
|
config;
|
|
36
36
|
static instance;
|
|
37
37
|
constructor() {
|
|
@@ -47,10 +47,10 @@ export class EnterpriseLogger {
|
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
static getInstance() {
|
|
50
|
-
if (!
|
|
51
|
-
|
|
50
|
+
if (!StructuredLogger.instance) {
|
|
51
|
+
StructuredLogger.instance = new StructuredLogger();
|
|
52
52
|
}
|
|
53
|
-
return
|
|
53
|
+
return StructuredLogger.instance;
|
|
54
54
|
}
|
|
55
55
|
configure(config) {
|
|
56
56
|
this.config = { ...this.config, ...config };
|
|
@@ -149,5 +149,5 @@ export class EnterpriseLogger {
|
|
|
149
149
|
this.log(LogLevel.FATAL, message, meta);
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
|
-
export const logger =
|
|
152
|
+
export const logger = StructuredLogger.getInstance();
|
|
153
153
|
//# sourceMappingURL=logger.js.map
|