@geekmidas/logger 10.0.0-alpha.98 → 10.0.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/CHANGELOG.md +48 -0
- package/dist/console.cjs +25 -24
- package/dist/console.cjs.map +1 -1
- package/dist/console.d.cts +7 -4
- package/dist/console.d.cts.map +1 -1
- package/dist/console.d.mts +7 -4
- package/dist/console.d.mts.map +1 -1
- package/dist/console.mjs +25 -23
- package/dist/console.mjs.map +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +3 -2
- package/dist/pino.cjs +39 -67
- package/dist/pino.cjs.map +1 -1
- package/dist/pino.d.cts +12 -9
- package/dist/pino.d.cts.map +1 -1
- package/dist/pino.d.mts +12 -9
- package/dist/pino.d.mts.map +1 -1
- package/dist/pino.mjs +16 -66
- package/dist/pino.mjs.map +1 -1
- package/dist/redact-paths-CsK0_uz-.d.cts +19 -0
- package/dist/redact-paths-CsK0_uz-.d.cts.map +1 -0
- package/dist/redact-paths-D07eTMlH.d.mts +19 -0
- package/dist/redact-paths-D07eTMlH.d.mts.map +1 -0
- package/dist/redact-paths-D0m0DIuQ.cjs +73 -0
- package/dist/redact-paths-D0m0DIuQ.cjs.map +1 -0
- package/dist/redact-paths-DQoIXhkS.mjs +67 -0
- package/dist/redact-paths-DQoIXhkS.mjs.map +1 -0
- package/dist/redact-paths.cjs +2 -116
- package/dist/redact-paths.d.cts +2 -31
- package/dist/redact-paths.d.mts +2 -31
- package/dist/redact-paths.mjs +2 -113
- package/dist/types-BDdpcrpy.d.mts +166 -0
- package/dist/types-BDdpcrpy.d.mts.map +1 -0
- package/dist/types-Dk_k2-f_.d.cts +166 -0
- package/dist/types-Dk_k2-f_.d.cts.map +1 -0
- package/dist/types-ag_0Cvbg.cjs +38 -0
- package/dist/types-ag_0Cvbg.cjs.map +1 -0
- package/dist/types-yQ6XOihF.mjs +32 -0
- package/dist/types-yQ6XOihF.mjs.map +1 -0
- package/dist/types.cjs +2 -32
- package/dist/types.d.cts +2 -175
- package/dist/types.d.mts +2 -175
- package/dist/types.mjs +2 -31
- package/package.json +5 -35
- package/src/__tests__/console.spec.ts +661 -0
- package/src/__tests__/pino-redaction.integration.spec.ts +307 -0
- package/src/__tests__/pino.spec.ts +355 -0
- package/src/console.ts +165 -0
- package/src/index.ts +7 -0
- package/src/pino.ts +129 -0
- package/src/redact-paths.ts +71 -0
- package/src/types.ts +167 -0
- package/tsconfig.json +9 -0
- package/tsdown.config.ts +3 -0
- package/dist/otel.cjs +0 -113
- package/dist/otel.cjs.map +0 -1
- package/dist/otel.d.cts +0 -31
- package/dist/otel.d.cts.map +0 -1
- package/dist/otel.d.mts +0 -31
- package/dist/otel.d.mts.map +0 -1
- package/dist/otel.mjs +0 -110
- package/dist/otel.mjs.map +0 -1
- package/dist/redact-paths.cjs.map +0 -1
- package/dist/redact-paths.d.cts.map +0 -1
- package/dist/redact-paths.d.mts.map +0 -1
- package/dist/redact-paths.mjs.map +0 -1
- package/dist/types.cjs.map +0 -1
- package/dist/types.d.cts.map +0 -1
- package/dist/types.d.mts.map +0 -1
- package/dist/types.mjs.map +0 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# @geekmidas/logger
|
|
2
|
+
|
|
3
|
+
## 10.0.0
|
|
4
|
+
|
|
5
|
+
## 9.0.2
|
|
6
|
+
|
|
7
|
+
### Patch Changes
|
|
8
|
+
|
|
9
|
+
- [#12](https://github.com/geekmidas/toolbox/pull/12) [`d53863a`](https://github.com/geekmidas/toolbox/commit/d53863a84db2e4ab5420e08f79128b637043fc42) Thanks [@geekmidas](https://github.com/geekmidas)! - Align every published package on a single version and keep them in step.
|
|
10
|
+
|
|
11
|
+
All packages now share one version, enforced by a changesets `fixed` group. The
|
|
12
|
+
baseline is 9.0.1 — @geekmidas/client's published version — so nothing moves
|
|
13
|
+
backwards; this release takes the whole set to 9.0.2 together.
|
|
14
|
+
|
|
15
|
+
Independent versions made "which version of the docs applies to me"
|
|
16
|
+
unanswerable: a reader on constructs@7 and cli@2 was on no version at all. One
|
|
17
|
+
number per release makes versioned documentation possible, and lets 9 freeze as
|
|
18
|
+
the current paradigm while the constructs rework is developed against it.
|
|
19
|
+
|
|
20
|
+
Every release now publishes every package, and a major anywhere is a major
|
|
21
|
+
everywhere. Peer ranges get simpler in return.
|
|
22
|
+
|
|
23
|
+
## 1.0.3
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- 🐛 [#11](https://github.com/geekmidas/toolbox/pull/11) [`40f4dc0`](https://github.com/geekmidas/toolbox/commit/40f4dc095911b2223a255029d8f776caf7781309) Thanks [@geekmidas](https://github.com/geekmidas)! - Patch release across all packages to realign published versions with the
|
|
28
|
+
registry. The previous release only published the four packages that had
|
|
29
|
+
version bumps; the remaining packages failed with "cannot publish over the
|
|
30
|
+
previously published versions" because their versions were unchanged.
|
|
31
|
+
|
|
32
|
+
## 1.0.2
|
|
33
|
+
|
|
34
|
+
### Patch Changes
|
|
35
|
+
|
|
36
|
+
- 🐛 [`d70c6c0`](https://github.com/geekmidas/toolbox/commit/d70c6c0aeb8a79da2473ac77dbd8255a4a2f5651) Thanks [@geekmidas](https://github.com/geekmidas)! - Fix `package.json` exports so TypeScript declarations resolve correctly under NodeNext/Bundler module resolution. Each subpath export now nests `types` inside its `import`/`require` condition, pointing at the `.d.mts` and `.d.cts` files that `tsdown` actually emits (previously the exports referenced non-existent `.d.ts` files, causing type-resolution failures for consumers). Both ESM (`.mjs`) and CJS (`.cjs`) runtime entry points are preserved. Additionally, `@geekmidas/ui` had `import` paths pointing at `.js` files that were never emitted — those are corrected to `.mjs`.
|
|
37
|
+
|
|
38
|
+
## 1.0.1
|
|
39
|
+
|
|
40
|
+
### Patch Changes
|
|
41
|
+
|
|
42
|
+
- ✨ [`0830c6e`](https://github.com/geekmidas/toolbox/commit/0830c6e0d60842526788e0e1f0e78827514ea7b3) Thanks [@geekmidas](https://github.com/geekmidas)! - Add optional sniff support
|
|
43
|
+
|
|
44
|
+
## 1.0.0
|
|
45
|
+
|
|
46
|
+
### Major Changes
|
|
47
|
+
|
|
48
|
+
- [`ff7b115`](https://github.com/geekmidas/toolbox/commit/ff7b11599f60f84ac6cdc73714c853ecf786b2e8) Thanks [@geekmidas](https://github.com/geekmidas)! - Version 1 Stable release
|
package/dist/console.cjs
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
const require_types = require('./types-ag_0Cvbg.cjs');
|
|
2
|
+
|
|
3
3
|
//#region src/console.ts
|
|
4
4
|
/**
|
|
5
5
|
* Numeric priority for log levels (higher = more severe)
|
|
6
6
|
*/
|
|
7
7
|
const LOG_LEVEL_PRIORITY = {
|
|
8
|
-
[
|
|
9
|
-
[
|
|
10
|
-
[
|
|
11
|
-
[
|
|
12
|
-
[
|
|
13
|
-
[
|
|
14
|
-
[
|
|
8
|
+
[require_types.LogLevel.Trace]: 10,
|
|
9
|
+
[require_types.LogLevel.Debug]: 20,
|
|
10
|
+
[require_types.LogLevel.Info]: 30,
|
|
11
|
+
[require_types.LogLevel.Warn]: 40,
|
|
12
|
+
[require_types.LogLevel.Error]: 50,
|
|
13
|
+
[require_types.LogLevel.Fatal]: 60,
|
|
14
|
+
[require_types.LogLevel.Silent]: 70
|
|
15
15
|
};
|
|
16
16
|
var ConsoleLogger = class ConsoleLogger {
|
|
17
|
-
data;
|
|
18
17
|
level;
|
|
19
18
|
/**
|
|
20
19
|
* Creates a new ConsoleLogger instance.
|
|
@@ -22,7 +21,7 @@ var ConsoleLogger = class ConsoleLogger {
|
|
|
22
21
|
* @param data - Initial context data to include in all log messages
|
|
23
22
|
* @param level - Minimum log level to output (default: Info)
|
|
24
23
|
*/
|
|
25
|
-
constructor(data = {}, level =
|
|
24
|
+
constructor(data = {}, level = require_types.LogLevel.Info) {
|
|
26
25
|
this.data = data;
|
|
27
26
|
this.level = level;
|
|
28
27
|
}
|
|
@@ -30,7 +29,7 @@ var ConsoleLogger = class ConsoleLogger {
|
|
|
30
29
|
* Checks if a log level should be output based on the configured minimum level.
|
|
31
30
|
*/
|
|
32
31
|
shouldLog(level) {
|
|
33
|
-
if (this.level ===
|
|
32
|
+
if (this.level === require_types.LogLevel.Silent) return false;
|
|
34
33
|
return LOG_LEVEL_PRIORITY[level] >= LOG_LEVEL_PRIORITY[this.level];
|
|
35
34
|
}
|
|
36
35
|
/**
|
|
@@ -46,14 +45,15 @@ var ConsoleLogger = class ConsoleLogger {
|
|
|
46
45
|
if (!this.shouldLog(level)) return;
|
|
47
46
|
const ts = Date.now();
|
|
48
47
|
if (typeof objOrMsg === "string") {
|
|
49
|
-
|
|
48
|
+
const logData$1 = {
|
|
50
49
|
...this.data,
|
|
51
50
|
msg: objOrMsg,
|
|
52
51
|
ts
|
|
53
|
-
}
|
|
52
|
+
};
|
|
53
|
+
logMethod(logData$1, ...args);
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
|
-
|
|
56
|
+
const logData = msg ? {
|
|
57
57
|
...this.data,
|
|
58
58
|
...objOrMsg,
|
|
59
59
|
msg,
|
|
@@ -62,21 +62,22 @@ var ConsoleLogger = class ConsoleLogger {
|
|
|
62
62
|
...this.data,
|
|
63
63
|
...objOrMsg,
|
|
64
64
|
ts
|
|
65
|
-
}
|
|
65
|
+
};
|
|
66
|
+
logMethod(logData, ...args);
|
|
66
67
|
};
|
|
67
68
|
}
|
|
68
69
|
/** Trace level logging function */
|
|
69
|
-
trace = this.createLogFn(console.trace.bind(console),
|
|
70
|
+
trace = this.createLogFn(console.trace.bind(console), require_types.LogLevel.Trace);
|
|
70
71
|
/** Debug level logging function */
|
|
71
|
-
debug = this.createLogFn(console.debug.bind(console),
|
|
72
|
+
debug = this.createLogFn(console.debug.bind(console), require_types.LogLevel.Debug);
|
|
72
73
|
/** Info level logging function */
|
|
73
|
-
info = this.createLogFn(console.info.bind(console),
|
|
74
|
+
info = this.createLogFn(console.info.bind(console), require_types.LogLevel.Info);
|
|
74
75
|
/** Warning level logging function */
|
|
75
|
-
warn = this.createLogFn(console.warn.bind(console),
|
|
76
|
+
warn = this.createLogFn(console.warn.bind(console), require_types.LogLevel.Warn);
|
|
76
77
|
/** Error level logging function */
|
|
77
|
-
error = this.createLogFn(console.error.bind(console),
|
|
78
|
+
error = this.createLogFn(console.error.bind(console), require_types.LogLevel.Error);
|
|
78
79
|
/** Fatal level logging function (uses console.error) */
|
|
79
|
-
fatal = this.createLogFn(console.error.bind(console),
|
|
80
|
+
fatal = this.createLogFn(console.error.bind(console), require_types.LogLevel.Fatal);
|
|
80
81
|
/**
|
|
81
82
|
* Creates a child logger with additional context data.
|
|
82
83
|
* The child logger inherits all context from the parent and adds its own.
|
|
@@ -141,11 +142,11 @@ const DEFAULT_LOGGER = new ConsoleLogger();
|
|
|
141
142
|
* ```
|
|
142
143
|
*/
|
|
143
144
|
function createLogger(options = {}) {
|
|
144
|
-
return new ConsoleLogger({}, options.level ??
|
|
145
|
+
return new ConsoleLogger({}, options.level ?? require_types.LogLevel.Info);
|
|
145
146
|
}
|
|
147
|
+
|
|
146
148
|
//#endregion
|
|
147
149
|
exports.ConsoleLogger = ConsoleLogger;
|
|
148
150
|
exports.DEFAULT_LOGGER = DEFAULT_LOGGER;
|
|
149
151
|
exports.createLogger = createLogger;
|
|
150
|
-
|
|
151
152
|
//# sourceMappingURL=console.cjs.map
|
package/dist/console.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"console.cjs","names":[],"sources":["../src/console.ts"],"sourcesContent":["import type { CreateLoggerOptions, LogFn, Logger } from './types';\nimport { LogLevel } from './types';\n\n/**\n * Numeric priority for log levels (higher = more severe)\n */\nconst LOG_LEVEL_PRIORITY: Record<LogLevel, number> = {\n\t[LogLevel.Trace]: 10,\n\t[LogLevel.Debug]: 20,\n\t[LogLevel.Info]: 30,\n\t[LogLevel.Warn]: 40,\n\t[LogLevel.Error]: 50,\n\t[LogLevel.Fatal]: 60,\n\t[LogLevel.Silent]: 70,\n};\n\nexport class ConsoleLogger implements Logger {\n\tprivate readonly level: LogLevel;\n\n\t/**\n\t * Creates a new ConsoleLogger instance.\n\t *\n\t * @param data - Initial context data to include in all log messages\n\t * @param level - Minimum log level to output (default: Info)\n\t */\n\tconstructor(\n\t\treadonly data: object = {},\n\t\tlevel: LogLevel = LogLevel.Info,\n\t) {\n\t\tthis.level = level;\n\t}\n\n\t/**\n\t * Checks if a log level should be output based on the configured minimum level.\n\t */\n\tprivate shouldLog(level: LogLevel): boolean {\n\t\tif (this.level === LogLevel.Silent) {\n\t\t\treturn false;\n\t\t}\n\t\treturn LOG_LEVEL_PRIORITY[level] >= LOG_LEVEL_PRIORITY[this.level];\n\t}\n\n\t/**\n\t * Creates a logging function that merges context data and adds timestamps.\n\t *\n\t * @param logMethod - The console method to use (e.g., console.log, console.error)\n\t * @param level - The log level for this method\n\t * @returns A LogFn that handles both structured and simple logging\n\t * @private\n\t */\n\tprivate createLogFn(\n\t\tlogMethod: (...args: any[]) => void,\n\t\tlevel: LogLevel,\n\t): LogFn {\n\t\treturn <T extends object>(\n\t\t\tobjOrMsg: T | string,\n\t\t\tmsg?: string,\n\t\t\t...args: any[]\n\t\t): void => {\n\t\t\tif (!this.shouldLog(level)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst ts = Date.now();\n\n\t\t\t// Handle simple string logging: logger.info('message')\n\t\t\tif (typeof objOrMsg === 'string') {\n\t\t\t\tconst logData = { ...this.data, msg: objOrMsg, ts };\n\t\t\t\tlogMethod(logData, ...args);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Handle structured logging: logger.info({ data }, 'message')\n\t\t\tconst logData = msg\n\t\t\t\t? { ...this.data, ...objOrMsg, msg, ts }\n\t\t\t\t: { ...this.data, ...objOrMsg, ts };\n\t\t\tlogMethod(logData, ...args);\n\t\t};\n\t}\n\n\t/** Trace level logging function */\n\ttrace: LogFn = this.createLogFn(console.trace.bind(console), LogLevel.Trace);\n\t/** Debug level logging function */\n\tdebug: LogFn = this.createLogFn(console.debug.bind(console), LogLevel.Debug);\n\t/** Info level logging function */\n\tinfo: LogFn = this.createLogFn(console.info.bind(console), LogLevel.Info);\n\t/** Warning level logging function */\n\twarn: LogFn = this.createLogFn(console.warn.bind(console), LogLevel.Warn);\n\t/** Error level logging function */\n\terror: LogFn = this.createLogFn(console.error.bind(console), LogLevel.Error);\n\t/** Fatal level logging function (uses console.error) */\n\tfatal: LogFn = this.createLogFn(console.error.bind(console), LogLevel.Fatal);\n\n\t/**\n\t * Creates a child logger with additional context data.\n\t * The child logger inherits all context from the parent and adds its own.\n\t *\n\t * @param obj - Additional context data for the child logger\n\t * @returns A new ConsoleLogger instance with merged context\n\t *\n\t * @example\n\t * ```typescript\n\t * const parentLogger = new ConsoleLogger({ app: 'myApp' });\n\t * const childLogger = parentLogger.child({ module: 'database' });\n\t * childLogger.info({ query: 'SELECT * FROM users' }, 'Query executed');\n\t * // Context includes both { app: 'myApp' } and { module: 'database' }\n\t * ```\n\t */\n\tchild(obj: object): Logger {\n\t\treturn new ConsoleLogger(\n\t\t\t{\n\t\t\t\t...this.data,\n\t\t\t\t...obj,\n\t\t\t},\n\t\t\tthis.level,\n\t\t);\n\t}\n}\n\n/**\n * @example Basic usage\n * ```typescript\n * const logger = new ConsoleLogger({ app: 'myApp' });\n * logger.info({ action: 'start' }, 'Application starting');\n * // Logs: { app: 'myApp', action: 'start', msg: 'Application starting', ts: 1234567890 }\n * ```\n *\n * @example Child logger usage\n * ```typescript\n * const childLogger = logger.child({ module: 'auth' });\n * childLogger.debug({ userId: 123 }, 'User authenticated');\n * // Logs: { app: 'myApp', module: 'auth', userId: 123, msg: 'User authenticated', ts: 1234567891 }\n * ```\n *\n * @example Error logging with context\n * ```typescript\n * try {\n * await someOperation();\n * } catch (error) {\n * logger.error({ error, operation: 'someOperation' }, 'Operation failed');\n * }\n * ```\n */\n\nexport const DEFAULT_LOGGER = new ConsoleLogger() as any;\n\n/**\n * Creates a console logger with the same API as pino's createLogger.\n *\n * @param options - Logger configuration options\n * @returns A ConsoleLogger instance\n *\n * @example\n * ```typescript\n * import { createLogger } from '@geekmidas/logger/console';\n * import { LogLevel } from '@geekmidas/logger';\n *\n * const logger = createLogger({ level: LogLevel.Debug });\n * logger.debug('This will be logged');\n * logger.trace('This will NOT be logged (below Debug level)');\n * ```\n */\nexport function createLogger(options: CreateLoggerOptions = {}): Logger {\n\treturn new ConsoleLogger({}, options.level ?? LogLevel.Info);\n}\n"],"mappings":";;;;;;AAMA,
|
|
1
|
+
{"version":3,"file":"console.cjs","names":["LOG_LEVEL_PRIORITY: Record<LogLevel, number>","LogLevel","data: object","level: LogLevel","logMethod: (...args: any[]) => void","objOrMsg: T | string","msg?: string","logData","obj: object","options: CreateLoggerOptions"],"sources":["../src/console.ts"],"sourcesContent":["import type { CreateLoggerOptions, LogFn, Logger } from './types';\nimport { LogLevel } from './types';\n\n/**\n * Numeric priority for log levels (higher = more severe)\n */\nconst LOG_LEVEL_PRIORITY: Record<LogLevel, number> = {\n\t[LogLevel.Trace]: 10,\n\t[LogLevel.Debug]: 20,\n\t[LogLevel.Info]: 30,\n\t[LogLevel.Warn]: 40,\n\t[LogLevel.Error]: 50,\n\t[LogLevel.Fatal]: 60,\n\t[LogLevel.Silent]: 70,\n};\n\nexport class ConsoleLogger implements Logger {\n\tprivate readonly level: LogLevel;\n\n\t/**\n\t * Creates a new ConsoleLogger instance.\n\t *\n\t * @param data - Initial context data to include in all log messages\n\t * @param level - Minimum log level to output (default: Info)\n\t */\n\tconstructor(\n\t\treadonly data: object = {},\n\t\tlevel: LogLevel = LogLevel.Info,\n\t) {\n\t\tthis.level = level;\n\t}\n\n\t/**\n\t * Checks if a log level should be output based on the configured minimum level.\n\t */\n\tprivate shouldLog(level: LogLevel): boolean {\n\t\tif (this.level === LogLevel.Silent) {\n\t\t\treturn false;\n\t\t}\n\t\treturn LOG_LEVEL_PRIORITY[level] >= LOG_LEVEL_PRIORITY[this.level];\n\t}\n\n\t/**\n\t * Creates a logging function that merges context data and adds timestamps.\n\t *\n\t * @param logMethod - The console method to use (e.g., console.log, console.error)\n\t * @param level - The log level for this method\n\t * @returns A LogFn that handles both structured and simple logging\n\t * @private\n\t */\n\tprivate createLogFn(\n\t\tlogMethod: (...args: any[]) => void,\n\t\tlevel: LogLevel,\n\t): LogFn {\n\t\treturn <T extends object>(\n\t\t\tobjOrMsg: T | string,\n\t\t\tmsg?: string,\n\t\t\t...args: any[]\n\t\t): void => {\n\t\t\tif (!this.shouldLog(level)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst ts = Date.now();\n\n\t\t\t// Handle simple string logging: logger.info('message')\n\t\t\tif (typeof objOrMsg === 'string') {\n\t\t\t\tconst logData = { ...this.data, msg: objOrMsg, ts };\n\t\t\t\tlogMethod(logData, ...args);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Handle structured logging: logger.info({ data }, 'message')\n\t\t\tconst logData = msg\n\t\t\t\t? { ...this.data, ...objOrMsg, msg, ts }\n\t\t\t\t: { ...this.data, ...objOrMsg, ts };\n\t\t\tlogMethod(logData, ...args);\n\t\t};\n\t}\n\n\t/** Trace level logging function */\n\ttrace: LogFn = this.createLogFn(console.trace.bind(console), LogLevel.Trace);\n\t/** Debug level logging function */\n\tdebug: LogFn = this.createLogFn(console.debug.bind(console), LogLevel.Debug);\n\t/** Info level logging function */\n\tinfo: LogFn = this.createLogFn(console.info.bind(console), LogLevel.Info);\n\t/** Warning level logging function */\n\twarn: LogFn = this.createLogFn(console.warn.bind(console), LogLevel.Warn);\n\t/** Error level logging function */\n\terror: LogFn = this.createLogFn(console.error.bind(console), LogLevel.Error);\n\t/** Fatal level logging function (uses console.error) */\n\tfatal: LogFn = this.createLogFn(console.error.bind(console), LogLevel.Fatal);\n\n\t/**\n\t * Creates a child logger with additional context data.\n\t * The child logger inherits all context from the parent and adds its own.\n\t *\n\t * @param obj - Additional context data for the child logger\n\t * @returns A new ConsoleLogger instance with merged context\n\t *\n\t * @example\n\t * ```typescript\n\t * const parentLogger = new ConsoleLogger({ app: 'myApp' });\n\t * const childLogger = parentLogger.child({ module: 'database' });\n\t * childLogger.info({ query: 'SELECT * FROM users' }, 'Query executed');\n\t * // Context includes both { app: 'myApp' } and { module: 'database' }\n\t * ```\n\t */\n\tchild(obj: object): Logger {\n\t\treturn new ConsoleLogger(\n\t\t\t{\n\t\t\t\t...this.data,\n\t\t\t\t...obj,\n\t\t\t},\n\t\t\tthis.level,\n\t\t);\n\t}\n}\n\n/**\n * @example Basic usage\n * ```typescript\n * const logger = new ConsoleLogger({ app: 'myApp' });\n * logger.info({ action: 'start' }, 'Application starting');\n * // Logs: { app: 'myApp', action: 'start', msg: 'Application starting', ts: 1234567890 }\n * ```\n *\n * @example Child logger usage\n * ```typescript\n * const childLogger = logger.child({ module: 'auth' });\n * childLogger.debug({ userId: 123 }, 'User authenticated');\n * // Logs: { app: 'myApp', module: 'auth', userId: 123, msg: 'User authenticated', ts: 1234567891 }\n * ```\n *\n * @example Error logging with context\n * ```typescript\n * try {\n * await someOperation();\n * } catch (error) {\n * logger.error({ error, operation: 'someOperation' }, 'Operation failed');\n * }\n * ```\n */\n\nexport const DEFAULT_LOGGER = new ConsoleLogger() as any;\n\n/**\n * Creates a console logger with the same API as pino's createLogger.\n *\n * @param options - Logger configuration options\n * @returns A ConsoleLogger instance\n *\n * @example\n * ```typescript\n * import { createLogger } from '@geekmidas/logger/console';\n * import { LogLevel } from '@geekmidas/logger';\n *\n * const logger = createLogger({ level: LogLevel.Debug });\n * logger.debug('This will be logged');\n * logger.trace('This will NOT be logged (below Debug level)');\n * ```\n */\nexport function createLogger(options: CreateLoggerOptions = {}): Logger {\n\treturn new ConsoleLogger({}, options.level ?? LogLevel.Info);\n}\n"],"mappings":";;;;;;AAMA,MAAMA,qBAA+C;EACnDC,uBAAS,QAAQ;EACjBA,uBAAS,QAAQ;EACjBA,uBAAS,OAAO;EAChBA,uBAAS,OAAO;EAChBA,uBAAS,QAAQ;EACjBA,uBAAS,QAAQ;EACjBA,uBAAS,SAAS;AACnB;AAED,IAAa,gBAAb,MAAa,cAAgC;CAC5C,AAAiB;;;;;;;CAQjB,YACUC,OAAe,CAAE,GAC1BC,QAAkBF,uBAAS,MAC1B;EAFQ;AAGT,OAAK,QAAQ;CACb;;;;CAKD,AAAQ,UAAUE,OAA0B;AAC3C,MAAI,KAAK,UAAUF,uBAAS,OAC3B,QAAO;AAER,SAAO,mBAAmB,UAAU,mBAAmB,KAAK;CAC5D;;;;;;;;;CAUD,AAAQ,YACPG,WACAD,OACQ;AACR,SAAO,CACNE,UACAC,KACA,GAAG,SACO;AACV,QAAK,KAAK,UAAU,MAAM,CACzB;GAGD,MAAM,KAAK,KAAK,KAAK;AAGrB,cAAW,aAAa,UAAU;IACjC,MAAMC,YAAU;KAAE,GAAG,KAAK;KAAM,KAAK;KAAU;IAAI;AACnD,cAAUA,WAAS,GAAG,KAAK;AAC3B;GACA;GAGD,MAAM,UAAU,MACb;IAAE,GAAG,KAAK;IAAM,GAAG;IAAU;IAAK;GAAI,IACtC;IAAE,GAAG,KAAK;IAAM,GAAG;IAAU;GAAI;AACpC,aAAU,SAAS,GAAG,KAAK;EAC3B;CACD;;CAGD,QAAe,KAAK,YAAY,QAAQ,MAAM,KAAK,QAAQ,EAAEN,uBAAS,MAAM;;CAE5E,QAAe,KAAK,YAAY,QAAQ,MAAM,KAAK,QAAQ,EAAEA,uBAAS,MAAM;;CAE5E,OAAc,KAAK,YAAY,QAAQ,KAAK,KAAK,QAAQ,EAAEA,uBAAS,KAAK;;CAEzE,OAAc,KAAK,YAAY,QAAQ,KAAK,KAAK,QAAQ,EAAEA,uBAAS,KAAK;;CAEzE,QAAe,KAAK,YAAY,QAAQ,MAAM,KAAK,QAAQ,EAAEA,uBAAS,MAAM;;CAE5E,QAAe,KAAK,YAAY,QAAQ,MAAM,KAAK,QAAQ,EAAEA,uBAAS,MAAM;;;;;;;;;;;;;;;;CAiB5E,MAAMO,KAAqB;AAC1B,SAAO,IAAI,cACV;GACC,GAAG,KAAK;GACR,GAAG;EACH,GACD,KAAK;CAEN;AACD;;;;;;;;;;;;;;;;;;;;;;;;;AA2BD,MAAa,iBAAiB,IAAI;;;;;;;;;;;;;;;;;AAkBlC,SAAgB,aAAaC,UAA+B,CAAE,GAAU;AACvE,QAAO,IAAI,cAAc,CAAE,GAAE,QAAQ,SAASR,uBAAS;AACvD"}
|
package/dist/console.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { CreateLoggerOptions, LogFn, LogLevel, Logger } from "./types.cjs";
|
|
1
|
+
import { CreateLoggerOptions, LogFn, LogLevel, Logger } from "./types-Dk_k2-f_.cjs";
|
|
2
|
+
|
|
2
3
|
//#region src/console.d.ts
|
|
3
|
-
|
|
4
|
+
declare class ConsoleLogger implements Logger {
|
|
4
5
|
readonly data: object;
|
|
5
6
|
private readonly level;
|
|
6
7
|
/**
|
|
@@ -76,7 +77,7 @@ export declare class ConsoleLogger implements Logger {
|
|
|
76
77
|
* }
|
|
77
78
|
* ```
|
|
78
79
|
*/
|
|
79
|
-
|
|
80
|
+
declare const DEFAULT_LOGGER: any;
|
|
80
81
|
/**
|
|
81
82
|
* Creates a console logger with the same API as pino's createLogger.
|
|
82
83
|
*
|
|
@@ -93,6 +94,8 @@ export declare const DEFAULT_LOGGER: any;
|
|
|
93
94
|
* logger.trace('This will NOT be logged (below Debug level)');
|
|
94
95
|
* ```
|
|
95
96
|
*/
|
|
96
|
-
|
|
97
|
+
declare function createLogger(options?: CreateLoggerOptions): Logger;
|
|
98
|
+
//# sourceMappingURL=console.d.ts.map
|
|
97
99
|
//#endregion
|
|
100
|
+
export { ConsoleLogger, DEFAULT_LOGGER, createLogger };
|
|
98
101
|
//# sourceMappingURL=console.d.cts.map
|
package/dist/console.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"console.d.cts","names":[],"sources":["../src/console.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"console.d.cts","names":[],"sources":["../src/console.ts"],"sourcesContent":[],"mappings":";;;cAgBa,aAAA,YAAyB;EAAzB,SAAA,IAAA,EAAA,MAAc;EAAA,iBAAA,KAAA;EAAA;;;;;;EAyEd,WAEL,CAAA,IAAA,CAAA,EAAA,MAAA,EAAA,KAAA,CAAA,EAhEC,QAgED;EAAK;;AA3E+B;EAgI/B,QAAA,SAA2C;EAkBxC;;;;AAAuD;;;;;;SAjF/D;;SAEA;;QAED;;QAEA;;SAEC;;SAEA;;;;;;;;;;;;;;;;sBAiBa;;;;;;;;;;;;;;;;;;;;;;;;;;cAoCR;;;;;;;;;;;;;;;;;iBAkBG,YAAA,WAAsB,sBAA2B"}
|
package/dist/console.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { CreateLoggerOptions, LogFn, LogLevel, Logger } from "./types.mjs";
|
|
1
|
+
import { CreateLoggerOptions, LogFn, LogLevel, Logger } from "./types-BDdpcrpy.mjs";
|
|
2
|
+
|
|
2
3
|
//#region src/console.d.ts
|
|
3
|
-
|
|
4
|
+
declare class ConsoleLogger implements Logger {
|
|
4
5
|
readonly data: object;
|
|
5
6
|
private readonly level;
|
|
6
7
|
/**
|
|
@@ -76,7 +77,7 @@ export declare class ConsoleLogger implements Logger {
|
|
|
76
77
|
* }
|
|
77
78
|
* ```
|
|
78
79
|
*/
|
|
79
|
-
|
|
80
|
+
declare const DEFAULT_LOGGER: any;
|
|
80
81
|
/**
|
|
81
82
|
* Creates a console logger with the same API as pino's createLogger.
|
|
82
83
|
*
|
|
@@ -93,6 +94,8 @@ export declare const DEFAULT_LOGGER: any;
|
|
|
93
94
|
* logger.trace('This will NOT be logged (below Debug level)');
|
|
94
95
|
* ```
|
|
95
96
|
*/
|
|
96
|
-
|
|
97
|
+
declare function createLogger(options?: CreateLoggerOptions): Logger;
|
|
98
|
+
//# sourceMappingURL=console.d.ts.map
|
|
97
99
|
//#endregion
|
|
100
|
+
export { ConsoleLogger, DEFAULT_LOGGER, createLogger };
|
|
98
101
|
//# sourceMappingURL=console.d.mts.map
|
package/dist/console.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"console.d.mts","names":[],"sources":["../src/console.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"console.d.mts","names":[],"sources":["../src/console.ts"],"sourcesContent":[],"mappings":";;;cAgBa,aAAA,YAAyB;EAAzB,SAAA,IAAA,EAAA,MAAc;EAAA,iBAAA,KAAA;EAAA;;;;;;EAyEd,WAEL,CAAA,IAAA,CAAA,EAAA,MAAA,EAAA,KAAA,CAAA,EAhEC,QAgED;EAAK;;AA3E+B;EAgI/B,QAAA,SAA2C;EAkBxC;;;;AAAuD;;;;;;SAjF/D;;SAEA;;QAED;;QAEA;;SAEC;;SAEA;;;;;;;;;;;;;;;;sBAiBa;;;;;;;;;;;;;;;;;;;;;;;;;;cAoCR;;;;;;;;;;;;;;;;;iBAkBG,YAAA,WAAsB,sBAA2B"}
|
package/dist/console.mjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import "./types.mjs";
|
|
1
|
+
import { LogLevel } from "./types-yQ6XOihF.mjs";
|
|
2
|
+
|
|
2
3
|
//#region src/console.ts
|
|
3
4
|
/**
|
|
4
5
|
* Numeric priority for log levels (higher = more severe)
|
|
5
6
|
*/
|
|
6
7
|
const LOG_LEVEL_PRIORITY = {
|
|
7
|
-
[
|
|
8
|
-
[
|
|
9
|
-
[
|
|
10
|
-
[
|
|
11
|
-
[
|
|
12
|
-
[
|
|
13
|
-
[
|
|
8
|
+
[LogLevel.Trace]: 10,
|
|
9
|
+
[LogLevel.Debug]: 20,
|
|
10
|
+
[LogLevel.Info]: 30,
|
|
11
|
+
[LogLevel.Warn]: 40,
|
|
12
|
+
[LogLevel.Error]: 50,
|
|
13
|
+
[LogLevel.Fatal]: 60,
|
|
14
|
+
[LogLevel.Silent]: 70
|
|
14
15
|
};
|
|
15
16
|
var ConsoleLogger = class ConsoleLogger {
|
|
16
|
-
data;
|
|
17
17
|
level;
|
|
18
18
|
/**
|
|
19
19
|
* Creates a new ConsoleLogger instance.
|
|
@@ -21,7 +21,7 @@ var ConsoleLogger = class ConsoleLogger {
|
|
|
21
21
|
* @param data - Initial context data to include in all log messages
|
|
22
22
|
* @param level - Minimum log level to output (default: Info)
|
|
23
23
|
*/
|
|
24
|
-
constructor(data = {}, level =
|
|
24
|
+
constructor(data = {}, level = LogLevel.Info) {
|
|
25
25
|
this.data = data;
|
|
26
26
|
this.level = level;
|
|
27
27
|
}
|
|
@@ -29,7 +29,7 @@ var ConsoleLogger = class ConsoleLogger {
|
|
|
29
29
|
* Checks if a log level should be output based on the configured minimum level.
|
|
30
30
|
*/
|
|
31
31
|
shouldLog(level) {
|
|
32
|
-
if (this.level ===
|
|
32
|
+
if (this.level === LogLevel.Silent) return false;
|
|
33
33
|
return LOG_LEVEL_PRIORITY[level] >= LOG_LEVEL_PRIORITY[this.level];
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
@@ -45,14 +45,15 @@ var ConsoleLogger = class ConsoleLogger {
|
|
|
45
45
|
if (!this.shouldLog(level)) return;
|
|
46
46
|
const ts = Date.now();
|
|
47
47
|
if (typeof objOrMsg === "string") {
|
|
48
|
-
|
|
48
|
+
const logData$1 = {
|
|
49
49
|
...this.data,
|
|
50
50
|
msg: objOrMsg,
|
|
51
51
|
ts
|
|
52
|
-
}
|
|
52
|
+
};
|
|
53
|
+
logMethod(logData$1, ...args);
|
|
53
54
|
return;
|
|
54
55
|
}
|
|
55
|
-
|
|
56
|
+
const logData = msg ? {
|
|
56
57
|
...this.data,
|
|
57
58
|
...objOrMsg,
|
|
58
59
|
msg,
|
|
@@ -61,21 +62,22 @@ var ConsoleLogger = class ConsoleLogger {
|
|
|
61
62
|
...this.data,
|
|
62
63
|
...objOrMsg,
|
|
63
64
|
ts
|
|
64
|
-
}
|
|
65
|
+
};
|
|
66
|
+
logMethod(logData, ...args);
|
|
65
67
|
};
|
|
66
68
|
}
|
|
67
69
|
/** Trace level logging function */
|
|
68
|
-
trace = this.createLogFn(console.trace.bind(console),
|
|
70
|
+
trace = this.createLogFn(console.trace.bind(console), LogLevel.Trace);
|
|
69
71
|
/** Debug level logging function */
|
|
70
|
-
debug = this.createLogFn(console.debug.bind(console),
|
|
72
|
+
debug = this.createLogFn(console.debug.bind(console), LogLevel.Debug);
|
|
71
73
|
/** Info level logging function */
|
|
72
|
-
info = this.createLogFn(console.info.bind(console),
|
|
74
|
+
info = this.createLogFn(console.info.bind(console), LogLevel.Info);
|
|
73
75
|
/** Warning level logging function */
|
|
74
|
-
warn = this.createLogFn(console.warn.bind(console),
|
|
76
|
+
warn = this.createLogFn(console.warn.bind(console), LogLevel.Warn);
|
|
75
77
|
/** Error level logging function */
|
|
76
|
-
error = this.createLogFn(console.error.bind(console),
|
|
78
|
+
error = this.createLogFn(console.error.bind(console), LogLevel.Error);
|
|
77
79
|
/** Fatal level logging function (uses console.error) */
|
|
78
|
-
fatal = this.createLogFn(console.error.bind(console),
|
|
80
|
+
fatal = this.createLogFn(console.error.bind(console), LogLevel.Fatal);
|
|
79
81
|
/**
|
|
80
82
|
* Creates a child logger with additional context data.
|
|
81
83
|
* The child logger inherits all context from the parent and adds its own.
|
|
@@ -140,9 +142,9 @@ const DEFAULT_LOGGER = new ConsoleLogger();
|
|
|
140
142
|
* ```
|
|
141
143
|
*/
|
|
142
144
|
function createLogger(options = {}) {
|
|
143
|
-
return new ConsoleLogger({}, options.level ??
|
|
145
|
+
return new ConsoleLogger({}, options.level ?? LogLevel.Info);
|
|
144
146
|
}
|
|
147
|
+
|
|
145
148
|
//#endregion
|
|
146
149
|
export { ConsoleLogger, DEFAULT_LOGGER, createLogger };
|
|
147
|
-
|
|
148
150
|
//# sourceMappingURL=console.mjs.map
|
package/dist/console.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"console.mjs","names":[],"sources":["../src/console.ts"],"sourcesContent":["import type { CreateLoggerOptions, LogFn, Logger } from './types';\nimport { LogLevel } from './types';\n\n/**\n * Numeric priority for log levels (higher = more severe)\n */\nconst LOG_LEVEL_PRIORITY: Record<LogLevel, number> = {\n\t[LogLevel.Trace]: 10,\n\t[LogLevel.Debug]: 20,\n\t[LogLevel.Info]: 30,\n\t[LogLevel.Warn]: 40,\n\t[LogLevel.Error]: 50,\n\t[LogLevel.Fatal]: 60,\n\t[LogLevel.Silent]: 70,\n};\n\nexport class ConsoleLogger implements Logger {\n\tprivate readonly level: LogLevel;\n\n\t/**\n\t * Creates a new ConsoleLogger instance.\n\t *\n\t * @param data - Initial context data to include in all log messages\n\t * @param level - Minimum log level to output (default: Info)\n\t */\n\tconstructor(\n\t\treadonly data: object = {},\n\t\tlevel: LogLevel = LogLevel.Info,\n\t) {\n\t\tthis.level = level;\n\t}\n\n\t/**\n\t * Checks if a log level should be output based on the configured minimum level.\n\t */\n\tprivate shouldLog(level: LogLevel): boolean {\n\t\tif (this.level === LogLevel.Silent) {\n\t\t\treturn false;\n\t\t}\n\t\treturn LOG_LEVEL_PRIORITY[level] >= LOG_LEVEL_PRIORITY[this.level];\n\t}\n\n\t/**\n\t * Creates a logging function that merges context data and adds timestamps.\n\t *\n\t * @param logMethod - The console method to use (e.g., console.log, console.error)\n\t * @param level - The log level for this method\n\t * @returns A LogFn that handles both structured and simple logging\n\t * @private\n\t */\n\tprivate createLogFn(\n\t\tlogMethod: (...args: any[]) => void,\n\t\tlevel: LogLevel,\n\t): LogFn {\n\t\treturn <T extends object>(\n\t\t\tobjOrMsg: T | string,\n\t\t\tmsg?: string,\n\t\t\t...args: any[]\n\t\t): void => {\n\t\t\tif (!this.shouldLog(level)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst ts = Date.now();\n\n\t\t\t// Handle simple string logging: logger.info('message')\n\t\t\tif (typeof objOrMsg === 'string') {\n\t\t\t\tconst logData = { ...this.data, msg: objOrMsg, ts };\n\t\t\t\tlogMethod(logData, ...args);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Handle structured logging: logger.info({ data }, 'message')\n\t\t\tconst logData = msg\n\t\t\t\t? { ...this.data, ...objOrMsg, msg, ts }\n\t\t\t\t: { ...this.data, ...objOrMsg, ts };\n\t\t\tlogMethod(logData, ...args);\n\t\t};\n\t}\n\n\t/** Trace level logging function */\n\ttrace: LogFn = this.createLogFn(console.trace.bind(console), LogLevel.Trace);\n\t/** Debug level logging function */\n\tdebug: LogFn = this.createLogFn(console.debug.bind(console), LogLevel.Debug);\n\t/** Info level logging function */\n\tinfo: LogFn = this.createLogFn(console.info.bind(console), LogLevel.Info);\n\t/** Warning level logging function */\n\twarn: LogFn = this.createLogFn(console.warn.bind(console), LogLevel.Warn);\n\t/** Error level logging function */\n\terror: LogFn = this.createLogFn(console.error.bind(console), LogLevel.Error);\n\t/** Fatal level logging function (uses console.error) */\n\tfatal: LogFn = this.createLogFn(console.error.bind(console), LogLevel.Fatal);\n\n\t/**\n\t * Creates a child logger with additional context data.\n\t * The child logger inherits all context from the parent and adds its own.\n\t *\n\t * @param obj - Additional context data for the child logger\n\t * @returns A new ConsoleLogger instance with merged context\n\t *\n\t * @example\n\t * ```typescript\n\t * const parentLogger = new ConsoleLogger({ app: 'myApp' });\n\t * const childLogger = parentLogger.child({ module: 'database' });\n\t * childLogger.info({ query: 'SELECT * FROM users' }, 'Query executed');\n\t * // Context includes both { app: 'myApp' } and { module: 'database' }\n\t * ```\n\t */\n\tchild(obj: object): Logger {\n\t\treturn new ConsoleLogger(\n\t\t\t{\n\t\t\t\t...this.data,\n\t\t\t\t...obj,\n\t\t\t},\n\t\t\tthis.level,\n\t\t);\n\t}\n}\n\n/**\n * @example Basic usage\n * ```typescript\n * const logger = new ConsoleLogger({ app: 'myApp' });\n * logger.info({ action: 'start' }, 'Application starting');\n * // Logs: { app: 'myApp', action: 'start', msg: 'Application starting', ts: 1234567890 }\n * ```\n *\n * @example Child logger usage\n * ```typescript\n * const childLogger = logger.child({ module: 'auth' });\n * childLogger.debug({ userId: 123 }, 'User authenticated');\n * // Logs: { app: 'myApp', module: 'auth', userId: 123, msg: 'User authenticated', ts: 1234567891 }\n * ```\n *\n * @example Error logging with context\n * ```typescript\n * try {\n * await someOperation();\n * } catch (error) {\n * logger.error({ error, operation: 'someOperation' }, 'Operation failed');\n * }\n * ```\n */\n\nexport const DEFAULT_LOGGER = new ConsoleLogger() as any;\n\n/**\n * Creates a console logger with the same API as pino's createLogger.\n *\n * @param options - Logger configuration options\n * @returns A ConsoleLogger instance\n *\n * @example\n * ```typescript\n * import { createLogger } from '@geekmidas/logger/console';\n * import { LogLevel } from '@geekmidas/logger';\n *\n * const logger = createLogger({ level: LogLevel.Debug });\n * logger.debug('This will be logged');\n * logger.trace('This will NOT be logged (below Debug level)');\n * ```\n */\nexport function createLogger(options: CreateLoggerOptions = {}): Logger {\n\treturn new ConsoleLogger({}, options.level ?? LogLevel.Info);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"console.mjs","names":["LOG_LEVEL_PRIORITY: Record<LogLevel, number>","data: object","level: LogLevel","logMethod: (...args: any[]) => void","objOrMsg: T | string","msg?: string","logData","obj: object","options: CreateLoggerOptions"],"sources":["../src/console.ts"],"sourcesContent":["import type { CreateLoggerOptions, LogFn, Logger } from './types';\nimport { LogLevel } from './types';\n\n/**\n * Numeric priority for log levels (higher = more severe)\n */\nconst LOG_LEVEL_PRIORITY: Record<LogLevel, number> = {\n\t[LogLevel.Trace]: 10,\n\t[LogLevel.Debug]: 20,\n\t[LogLevel.Info]: 30,\n\t[LogLevel.Warn]: 40,\n\t[LogLevel.Error]: 50,\n\t[LogLevel.Fatal]: 60,\n\t[LogLevel.Silent]: 70,\n};\n\nexport class ConsoleLogger implements Logger {\n\tprivate readonly level: LogLevel;\n\n\t/**\n\t * Creates a new ConsoleLogger instance.\n\t *\n\t * @param data - Initial context data to include in all log messages\n\t * @param level - Minimum log level to output (default: Info)\n\t */\n\tconstructor(\n\t\treadonly data: object = {},\n\t\tlevel: LogLevel = LogLevel.Info,\n\t) {\n\t\tthis.level = level;\n\t}\n\n\t/**\n\t * Checks if a log level should be output based on the configured minimum level.\n\t */\n\tprivate shouldLog(level: LogLevel): boolean {\n\t\tif (this.level === LogLevel.Silent) {\n\t\t\treturn false;\n\t\t}\n\t\treturn LOG_LEVEL_PRIORITY[level] >= LOG_LEVEL_PRIORITY[this.level];\n\t}\n\n\t/**\n\t * Creates a logging function that merges context data and adds timestamps.\n\t *\n\t * @param logMethod - The console method to use (e.g., console.log, console.error)\n\t * @param level - The log level for this method\n\t * @returns A LogFn that handles both structured and simple logging\n\t * @private\n\t */\n\tprivate createLogFn(\n\t\tlogMethod: (...args: any[]) => void,\n\t\tlevel: LogLevel,\n\t): LogFn {\n\t\treturn <T extends object>(\n\t\t\tobjOrMsg: T | string,\n\t\t\tmsg?: string,\n\t\t\t...args: any[]\n\t\t): void => {\n\t\t\tif (!this.shouldLog(level)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst ts = Date.now();\n\n\t\t\t// Handle simple string logging: logger.info('message')\n\t\t\tif (typeof objOrMsg === 'string') {\n\t\t\t\tconst logData = { ...this.data, msg: objOrMsg, ts };\n\t\t\t\tlogMethod(logData, ...args);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Handle structured logging: logger.info({ data }, 'message')\n\t\t\tconst logData = msg\n\t\t\t\t? { ...this.data, ...objOrMsg, msg, ts }\n\t\t\t\t: { ...this.data, ...objOrMsg, ts };\n\t\t\tlogMethod(logData, ...args);\n\t\t};\n\t}\n\n\t/** Trace level logging function */\n\ttrace: LogFn = this.createLogFn(console.trace.bind(console), LogLevel.Trace);\n\t/** Debug level logging function */\n\tdebug: LogFn = this.createLogFn(console.debug.bind(console), LogLevel.Debug);\n\t/** Info level logging function */\n\tinfo: LogFn = this.createLogFn(console.info.bind(console), LogLevel.Info);\n\t/** Warning level logging function */\n\twarn: LogFn = this.createLogFn(console.warn.bind(console), LogLevel.Warn);\n\t/** Error level logging function */\n\terror: LogFn = this.createLogFn(console.error.bind(console), LogLevel.Error);\n\t/** Fatal level logging function (uses console.error) */\n\tfatal: LogFn = this.createLogFn(console.error.bind(console), LogLevel.Fatal);\n\n\t/**\n\t * Creates a child logger with additional context data.\n\t * The child logger inherits all context from the parent and adds its own.\n\t *\n\t * @param obj - Additional context data for the child logger\n\t * @returns A new ConsoleLogger instance with merged context\n\t *\n\t * @example\n\t * ```typescript\n\t * const parentLogger = new ConsoleLogger({ app: 'myApp' });\n\t * const childLogger = parentLogger.child({ module: 'database' });\n\t * childLogger.info({ query: 'SELECT * FROM users' }, 'Query executed');\n\t * // Context includes both { app: 'myApp' } and { module: 'database' }\n\t * ```\n\t */\n\tchild(obj: object): Logger {\n\t\treturn new ConsoleLogger(\n\t\t\t{\n\t\t\t\t...this.data,\n\t\t\t\t...obj,\n\t\t\t},\n\t\t\tthis.level,\n\t\t);\n\t}\n}\n\n/**\n * @example Basic usage\n * ```typescript\n * const logger = new ConsoleLogger({ app: 'myApp' });\n * logger.info({ action: 'start' }, 'Application starting');\n * // Logs: { app: 'myApp', action: 'start', msg: 'Application starting', ts: 1234567890 }\n * ```\n *\n * @example Child logger usage\n * ```typescript\n * const childLogger = logger.child({ module: 'auth' });\n * childLogger.debug({ userId: 123 }, 'User authenticated');\n * // Logs: { app: 'myApp', module: 'auth', userId: 123, msg: 'User authenticated', ts: 1234567891 }\n * ```\n *\n * @example Error logging with context\n * ```typescript\n * try {\n * await someOperation();\n * } catch (error) {\n * logger.error({ error, operation: 'someOperation' }, 'Operation failed');\n * }\n * ```\n */\n\nexport const DEFAULT_LOGGER = new ConsoleLogger() as any;\n\n/**\n * Creates a console logger with the same API as pino's createLogger.\n *\n * @param options - Logger configuration options\n * @returns A ConsoleLogger instance\n *\n * @example\n * ```typescript\n * import { createLogger } from '@geekmidas/logger/console';\n * import { LogLevel } from '@geekmidas/logger';\n *\n * const logger = createLogger({ level: LogLevel.Debug });\n * logger.debug('This will be logged');\n * logger.trace('This will NOT be logged (below Debug level)');\n * ```\n */\nexport function createLogger(options: CreateLoggerOptions = {}): Logger {\n\treturn new ConsoleLogger({}, options.level ?? LogLevel.Info);\n}\n"],"mappings":";;;;;;AAMA,MAAMA,qBAA+C;EACnD,SAAS,QAAQ;EACjB,SAAS,QAAQ;EACjB,SAAS,OAAO;EAChB,SAAS,OAAO;EAChB,SAAS,QAAQ;EACjB,SAAS,QAAQ;EACjB,SAAS,SAAS;AACnB;AAED,IAAa,gBAAb,MAAa,cAAgC;CAC5C,AAAiB;;;;;;;CAQjB,YACUC,OAAe,CAAE,GAC1BC,QAAkB,SAAS,MAC1B;EAFQ;AAGT,OAAK,QAAQ;CACb;;;;CAKD,AAAQ,UAAUA,OAA0B;AAC3C,MAAI,KAAK,UAAU,SAAS,OAC3B,QAAO;AAER,SAAO,mBAAmB,UAAU,mBAAmB,KAAK;CAC5D;;;;;;;;;CAUD,AAAQ,YACPC,WACAD,OACQ;AACR,SAAO,CACNE,UACAC,KACA,GAAG,SACO;AACV,QAAK,KAAK,UAAU,MAAM,CACzB;GAGD,MAAM,KAAK,KAAK,KAAK;AAGrB,cAAW,aAAa,UAAU;IACjC,MAAMC,YAAU;KAAE,GAAG,KAAK;KAAM,KAAK;KAAU;IAAI;AACnD,cAAUA,WAAS,GAAG,KAAK;AAC3B;GACA;GAGD,MAAM,UAAU,MACb;IAAE,GAAG,KAAK;IAAM,GAAG;IAAU;IAAK;GAAI,IACtC;IAAE,GAAG,KAAK;IAAM,GAAG;IAAU;GAAI;AACpC,aAAU,SAAS,GAAG,KAAK;EAC3B;CACD;;CAGD,QAAe,KAAK,YAAY,QAAQ,MAAM,KAAK,QAAQ,EAAE,SAAS,MAAM;;CAE5E,QAAe,KAAK,YAAY,QAAQ,MAAM,KAAK,QAAQ,EAAE,SAAS,MAAM;;CAE5E,OAAc,KAAK,YAAY,QAAQ,KAAK,KAAK,QAAQ,EAAE,SAAS,KAAK;;CAEzE,OAAc,KAAK,YAAY,QAAQ,KAAK,KAAK,QAAQ,EAAE,SAAS,KAAK;;CAEzE,QAAe,KAAK,YAAY,QAAQ,MAAM,KAAK,QAAQ,EAAE,SAAS,MAAM;;CAE5E,QAAe,KAAK,YAAY,QAAQ,MAAM,KAAK,QAAQ,EAAE,SAAS,MAAM;;;;;;;;;;;;;;;;CAiB5E,MAAMC,KAAqB;AAC1B,SAAO,IAAI,cACV;GACC,GAAG,KAAK;GACR,GAAG;EACH,GACD,KAAK;CAEN;AACD;;;;;;;;;;;;;;;;;;;;;;;;;AA2BD,MAAa,iBAAiB,IAAI;;;;;;;;;;;;;;;;;AAkBlC,SAAgB,aAAaC,UAA+B,CAAE,GAAU;AACvE,QAAO,IAAI,cAAc,CAAE,GAAE,QAAQ,SAAS,SAAS;AACvD"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.LogLevel = require_types.LogLevel;
|
|
1
|
+
const require_types = require('./types-ag_0Cvbg.cjs');
|
|
2
|
+
|
|
3
|
+
exports.LogLevel = require_types.LogLevel;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CreateLoggerOptions, LogFn, LogLevel, Logger, RedactOptions } from "./types.cjs";
|
|
2
|
-
export {
|
|
1
|
+
import { CreateLoggerOptions, LogFn, LogLevel, Logger, RedactOptions } from "./types-Dk_k2-f_.cjs";
|
|
2
|
+
export { CreateLoggerOptions, LogFn, LogLevel, Logger, RedactOptions };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CreateLoggerOptions, LogFn, LogLevel, Logger, RedactOptions } from "./types.mjs";
|
|
2
|
-
export {
|
|
1
|
+
import { CreateLoggerOptions, LogFn, LogLevel, Logger, RedactOptions } from "./types-BDdpcrpy.mjs";
|
|
2
|
+
export { CreateLoggerOptions, LogFn, LogLevel, Logger, RedactOptions };
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { LogLevel } from "./types.mjs";
|
|
2
|
-
|
|
1
|
+
import { LogLevel } from "./types-yQ6XOihF.mjs";
|
|
2
|
+
|
|
3
|
+
export { LogLevel };
|
package/dist/pino.cjs
CHANGED
|
@@ -1,54 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
//#region rolldown:runtime
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
const require_redact_paths = require('./redact-paths-D0m0DIuQ.cjs');
|
|
25
|
+
const pino = __toESM(require("pino"));
|
|
26
|
+
|
|
5
27
|
//#region src/pino.ts
|
|
6
28
|
/**
|
|
7
|
-
* Pino logger with built-in redaction support for sensitive data.
|
|
8
|
-
*
|
|
9
|
-
* Redaction is on by default: a logger that was never told about passwords
|
|
10
|
-
* and tokens still masks them. `redact: false` is the explicit opt-out.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```typescript
|
|
14
|
-
* import { createLogger, DEFAULT_REDACT_PATHS } from '@geekmidas/logger/pino';
|
|
15
|
-
*
|
|
16
|
-
* // Redaction with sensible defaults — the same as `redact: true`
|
|
17
|
-
* const logger = createLogger();
|
|
18
|
-
*
|
|
19
|
-
* // Sensitive data is automatically masked
|
|
20
|
-
* logger.info({ password: 'secret123', user: 'john' }, 'Login');
|
|
21
|
-
* // Output: { password: '[Redacted]', user: 'john' } Login
|
|
22
|
-
*
|
|
23
|
-
* // Add custom paths (merged with defaults)
|
|
24
|
-
* const logger2 = createLogger({ redact: ['user.ssn'] });
|
|
25
|
-
*
|
|
26
|
-
* // Override defaults for full control
|
|
27
|
-
* const logger3 = createLogger({
|
|
28
|
-
* redact: {
|
|
29
|
-
* paths: ['onlyThis'],
|
|
30
|
-
* resolution: 'override',
|
|
31
|
-
* }
|
|
32
|
-
* });
|
|
33
|
-
* ```
|
|
34
|
-
*
|
|
35
|
-
* @module
|
|
36
|
-
*/
|
|
37
|
-
/**
|
|
38
29
|
* Resolves redaction configuration from options.
|
|
39
|
-
* Returns undefined
|
|
40
|
-
* unset is the same as `true`, so sensitive paths are masked unless someone
|
|
41
|
-
* decides they should not be.
|
|
30
|
+
* Returns undefined if redaction is disabled, or a pino-compatible redact config.
|
|
42
31
|
*
|
|
43
32
|
* By default (resolution: 'merge'), custom paths are merged with DEFAULT_REDACT_PATHS.
|
|
44
33
|
* With resolution: 'override', only the custom paths are used.
|
|
45
34
|
*/
|
|
46
35
|
function resolveRedactConfig(redact) {
|
|
47
|
-
if (redact === false) return;
|
|
48
|
-
if (redact ===
|
|
36
|
+
if (redact === void 0 || redact === false) return void 0;
|
|
37
|
+
if (redact === true) return require_redact_paths.DEFAULT_REDACT_PATHS;
|
|
49
38
|
if (Array.isArray(redact)) return [...require_redact_paths.DEFAULT_REDACT_PATHS, ...redact];
|
|
50
39
|
const { resolution = "merge", paths, censor, remove } = redact;
|
|
51
|
-
const
|
|
40
|
+
const resolvedPaths = resolution === "override" ? paths : [...require_redact_paths.DEFAULT_REDACT_PATHS, ...paths];
|
|
41
|
+
const config = { paths: resolvedPaths };
|
|
52
42
|
if (censor !== void 0) config.censor = censor;
|
|
53
43
|
if (remove !== void 0) config.remove = remove;
|
|
54
44
|
return config;
|
|
@@ -61,45 +51,28 @@ function resolveRedactConfig(redact) {
|
|
|
61
51
|
*
|
|
62
52
|
* @example
|
|
63
53
|
* ```typescript
|
|
64
|
-
* // Basic logger
|
|
54
|
+
* // Basic logger
|
|
65
55
|
* const logger = createLogger({ level: 'debug' });
|
|
66
56
|
*
|
|
67
|
-
* //
|
|
68
|
-
* const
|
|
57
|
+
* // With redaction enabled
|
|
58
|
+
* const secureLogger = createLogger({ redact: true });
|
|
69
59
|
*
|
|
70
60
|
* // Pretty printing in development
|
|
71
|
-
* const devLogger = createLogger({ pretty: true });
|
|
61
|
+
* const devLogger = createLogger({ pretty: true, redact: true });
|
|
72
62
|
* ```
|
|
73
63
|
*/
|
|
74
64
|
function createLogger(options = {}) {
|
|
75
|
-
const pretty = options?.pretty && process.
|
|
65
|
+
const pretty = options?.pretty && process.NODE_ENV !== "production";
|
|
76
66
|
const baseOptions = pretty ? { transport: {
|
|
77
67
|
target: "pino-pretty",
|
|
78
68
|
options: { colorize: true }
|
|
79
69
|
} } : {};
|
|
80
70
|
const redact = resolveRedactConfig(options.redact);
|
|
81
|
-
|
|
82
|
-
const serialized = pino.stdSerializers.err(value);
|
|
83
|
-
if (!redact || serialized === value) return serialized;
|
|
84
|
-
return require_redact_paths.redactUrlCredentialsIn({ ...serialized });
|
|
85
|
-
};
|
|
86
|
-
const pinoOptions = {
|
|
71
|
+
return (0, pino.pino)({
|
|
87
72
|
...baseOptions,
|
|
88
73
|
...options.level && { level: options.level },
|
|
89
74
|
...redact && { redact },
|
|
90
|
-
serializers: {
|
|
91
|
-
err: serializeError,
|
|
92
|
-
error: serializeError
|
|
93
|
-
},
|
|
94
|
-
hooks: {
|
|
95
|
-
...redact && { logMethod(args, method) {
|
|
96
|
-
const redacted = args.map((arg) => typeof arg === "string" ? require_redact_paths.redactUrlCredentials(arg) : arg);
|
|
97
|
-
return method.apply(this, redacted);
|
|
98
|
-
} },
|
|
99
|
-
streamWrite: require_otel.otelStreamWrite
|
|
100
|
-
},
|
|
101
75
|
formatters: {
|
|
102
|
-
...redact && { log: (object) => require_redact_paths.redactUrlCredentialsIn(object) },
|
|
103
76
|
bindings() {
|
|
104
77
|
return { nodeVersion: process.version };
|
|
105
78
|
},
|
|
@@ -107,11 +80,10 @@ function createLogger(options = {}) {
|
|
|
107
80
|
return { level: label.toUpperCase() };
|
|
108
81
|
}
|
|
109
82
|
}
|
|
110
|
-
};
|
|
111
|
-
return options.destination && !pretty ? (0, pino.pino)(pinoOptions, options.destination) : (0, pino.pino)(pinoOptions);
|
|
83
|
+
});
|
|
112
84
|
}
|
|
85
|
+
|
|
113
86
|
//#endregion
|
|
114
87
|
exports.DEFAULT_REDACT_PATHS = require_redact_paths.DEFAULT_REDACT_PATHS;
|
|
115
88
|
exports.createLogger = createLogger;
|
|
116
|
-
|
|
117
89
|
//# sourceMappingURL=pino.cjs.map
|
package/dist/pino.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pino.cjs","names":["
|
|
1
|
+
{"version":3,"file":"pino.cjs","names":["redact: boolean | RedactOptions | undefined","DEFAULT_REDACT_PATHS","config: PinoRedactConfig","options: CreateLoggerOptions"],"sources":["../src/pino.ts"],"sourcesContent":["/**\n * Pino logger with built-in redaction support for sensitive data.\n *\n * @example\n * ```typescript\n * import { createLogger, DEFAULT_REDACT_PATHS } from '@geekmidas/logger/pino';\n *\n * // Enable redaction with sensible defaults\n * const logger = createLogger({ redact: true });\n *\n * // Sensitive data is automatically masked\n * logger.info({ password: 'secret123', user: 'john' }, 'Login');\n * // Output: { password: '[Redacted]', user: 'john' } Login\n *\n * // Add custom paths (merged with defaults)\n * const logger2 = createLogger({ redact: ['user.ssn'] });\n *\n * // Override defaults for full control\n * const logger3 = createLogger({\n * redact: {\n * paths: ['onlyThis'],\n * resolution: 'override',\n * }\n * });\n * ```\n *\n * @module\n */\nimport { pino } from 'pino';\nimport { DEFAULT_REDACT_PATHS } from './redact-paths';\nimport type { CreateLoggerOptions, RedactOptions } from './types';\n\n// Re-export for backwards compatibility\nexport { DEFAULT_REDACT_PATHS } from './redact-paths';\n\n/**\n * Type for the resolved pino redact config (without our custom resolution field).\n */\ntype PinoRedactConfig =\n\t| string[]\n\t| {\n\t\t\tpaths: string[];\n\t\t\tcensor?: string | ((value: unknown, path: string[]) => unknown);\n\t\t\tremove?: boolean;\n\t };\n\n/**\n * Resolves redaction configuration from options.\n * Returns undefined if redaction is disabled, or a pino-compatible redact config.\n *\n * By default (resolution: 'merge'), custom paths are merged with DEFAULT_REDACT_PATHS.\n * With resolution: 'override', only the custom paths are used.\n */\nfunction resolveRedactConfig(\n\tredact: boolean | RedactOptions | undefined,\n): PinoRedactConfig | undefined {\n\tif (redact === undefined || redact === false) {\n\t\treturn undefined;\n\t}\n\n\tif (redact === true) {\n\t\treturn DEFAULT_REDACT_PATHS;\n\t}\n\n\t// Array syntax - merge with defaults\n\tif (Array.isArray(redact)) {\n\t\treturn [...DEFAULT_REDACT_PATHS, ...redact];\n\t}\n\n\t// Object syntax - check resolution mode\n\tconst { resolution = 'merge', paths, censor, remove } = redact;\n\n\tconst resolvedPaths =\n\t\tresolution === 'override' ? paths : [...DEFAULT_REDACT_PATHS, ...paths];\n\n\t// Return clean pino config without our resolution field\n\tconst config: PinoRedactConfig = { paths: resolvedPaths };\n\tif (censor !== undefined) config.censor = censor;\n\tif (remove !== undefined) config.remove = remove;\n\n\treturn config;\n}\n\n/**\n * Creates a pino logger instance with optional redaction support.\n *\n * @param options - Logger configuration options\n * @returns A configured pino logger instance\n *\n * @example\n * ```typescript\n * // Basic logger\n * const logger = createLogger({ level: 'debug' });\n *\n * // With redaction enabled\n * const secureLogger = createLogger({ redact: true });\n *\n * // Pretty printing in development\n * const devLogger = createLogger({ pretty: true, redact: true });\n * ```\n */\nexport function createLogger(options: CreateLoggerOptions = {}) {\n\t// @ts-expect-error\n\tconst pretty = options?.pretty && process.NODE_ENV !== 'production';\n\tconst baseOptions = pretty\n\t\t? {\n\t\t\t\ttransport: {\n\t\t\t\t\ttarget: 'pino-pretty',\n\t\t\t\t\toptions: { colorize: true },\n\t\t\t\t},\n\t\t\t}\n\t\t: {};\n\n\tconst redact = resolveRedactConfig(options.redact);\n\n\treturn pino({\n\t\t...baseOptions,\n\t\t...(options.level && { level: options.level }),\n\t\t...(redact && { redact }),\n\t\tformatters: {\n\t\t\tbindings() {\n\t\t\t\treturn { nodeVersion: process.version };\n\t\t\t},\n\t\t\tlevel: (label) => {\n\t\t\t\treturn { level: label.toUpperCase() };\n\t\t\t},\n\t\t},\n\t});\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,SAAS,oBACRA,QAC+B;AAC/B,KAAI,qBAAwB,WAAW,MACtC;AAGD,KAAI,WAAW,KACd,QAAOC;AAIR,KAAI,MAAM,QAAQ,OAAO,CACxB,QAAO,CAAC,GAAGA,2CAAsB,GAAG,MAAO;CAI5C,MAAM,EAAE,aAAa,SAAS,OAAO,QAAQ,QAAQ,GAAG;CAExD,MAAM,gBACL,eAAe,aAAa,QAAQ,CAAC,GAAGA,2CAAsB,GAAG,KAAM;CAGxE,MAAMC,SAA2B,EAAE,OAAO,cAAe;AACzD,KAAI,kBAAsB,QAAO,SAAS;AAC1C,KAAI,kBAAsB,QAAO,SAAS;AAE1C,QAAO;AACP;;;;;;;;;;;;;;;;;;;AAoBD,SAAgB,aAAaC,UAA+B,CAAE,GAAE;CAE/D,MAAM,SAAS,SAAS,UAAU,QAAQ,aAAa;CACvD,MAAM,cAAc,SACjB,EACA,WAAW;EACV,QAAQ;EACR,SAAS,EAAE,UAAU,KAAM;CAC3B,EACD,IACA,CAAE;CAEL,MAAM,SAAS,oBAAoB,QAAQ,OAAO;AAElD,QAAO,eAAK;EACX,GAAG;EACH,GAAI,QAAQ,SAAS,EAAE,OAAO,QAAQ,MAAO;EAC7C,GAAI,UAAU,EAAE,OAAQ;EACxB,YAAY;GACX,WAAW;AACV,WAAO,EAAE,aAAa,QAAQ,QAAS;GACvC;GACD,OAAO,CAAC,UAAU;AACjB,WAAO,EAAE,OAAO,MAAM,aAAa,CAAE;GACrC;EACD;CACD,EAAC;AACF"}
|