@geekmidas/logger 10.0.0-alpha.4 → 10.0.0-alpha.40

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.
Files changed (53) hide show
  1. package/dist/console.cjs +24 -25
  2. package/dist/console.cjs.map +1 -1
  3. package/dist/console.d.cts +4 -7
  4. package/dist/console.d.cts.map +1 -1
  5. package/dist/console.d.mts +4 -7
  6. package/dist/console.d.mts.map +1 -1
  7. package/dist/console.mjs +23 -25
  8. package/dist/console.mjs.map +1 -1
  9. package/dist/index.cjs +3 -3
  10. package/dist/index.d.cts +2 -2
  11. package/dist/index.d.mts +2 -2
  12. package/dist/index.mjs +2 -3
  13. package/dist/pino.cjs +35 -32
  14. package/dist/pino.cjs.map +1 -1
  15. package/dist/pino.d.cts +4 -8
  16. package/dist/pino.d.cts.map +1 -1
  17. package/dist/pino.d.mts +4 -8
  18. package/dist/pino.d.mts.map +1 -1
  19. package/dist/pino.mjs +33 -8
  20. package/dist/pino.mjs.map +1 -1
  21. package/dist/redact-paths.cjs +67 -2
  22. package/dist/redact-paths.cjs.map +1 -0
  23. package/dist/redact-paths.d.cts +17 -2
  24. package/dist/redact-paths.d.cts.map +1 -0
  25. package/dist/redact-paths.d.mts +17 -2
  26. package/dist/redact-paths.d.mts.map +1 -0
  27. package/dist/redact-paths.mjs +66 -2
  28. package/dist/redact-paths.mjs.map +1 -0
  29. package/dist/types.cjs +32 -2
  30. package/dist/types.cjs.map +1 -0
  31. package/dist/types.d.cts +164 -2
  32. package/dist/types.d.cts.map +1 -0
  33. package/dist/types.d.mts +164 -2
  34. package/dist/types.d.mts.map +1 -0
  35. package/dist/types.mjs +31 -2
  36. package/dist/types.mjs.map +1 -0
  37. package/package.json +1 -1
  38. package/dist/redact-paths-CsK0_uz-.d.cts +0 -19
  39. package/dist/redact-paths-CsK0_uz-.d.cts.map +0 -1
  40. package/dist/redact-paths-D07eTMlH.d.mts +0 -19
  41. package/dist/redact-paths-D07eTMlH.d.mts.map +0 -1
  42. package/dist/redact-paths-D0m0DIuQ.cjs +0 -73
  43. package/dist/redact-paths-D0m0DIuQ.cjs.map +0 -1
  44. package/dist/redact-paths-DQoIXhkS.mjs +0 -67
  45. package/dist/redact-paths-DQoIXhkS.mjs.map +0 -1
  46. package/dist/types-BDdpcrpy.d.mts +0 -166
  47. package/dist/types-BDdpcrpy.d.mts.map +0 -1
  48. package/dist/types-Dk_k2-f_.d.cts +0 -166
  49. package/dist/types-Dk_k2-f_.d.cts.map +0 -1
  50. package/dist/types-ag_0Cvbg.cjs +0 -38
  51. package/dist/types-ag_0Cvbg.cjs.map +0 -1
  52. package/dist/types-yQ6XOihF.mjs +0 -32
  53. package/dist/types-yQ6XOihF.mjs.map +0 -1
package/dist/console.cjs CHANGED
@@ -1,19 +1,20 @@
1
- const require_types = require('./types-ag_0Cvbg.cjs');
2
-
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ require("./types.cjs");
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
- [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
8
+ ["trace"]: 10,
9
+ ["debug"]: 20,
10
+ ["info"]: 30,
11
+ ["warn"]: 40,
12
+ ["error"]: 50,
13
+ ["fatal"]: 60,
14
+ ["silent"]: 70
15
15
  };
16
16
  var ConsoleLogger = class ConsoleLogger {
17
+ data;
17
18
  level;
18
19
  /**
19
20
  * Creates a new ConsoleLogger instance.
@@ -21,7 +22,7 @@ var ConsoleLogger = class ConsoleLogger {
21
22
  * @param data - Initial context data to include in all log messages
22
23
  * @param level - Minimum log level to output (default: Info)
23
24
  */
24
- constructor(data = {}, level = require_types.LogLevel.Info) {
25
+ constructor(data = {}, level = "info") {
25
26
  this.data = data;
26
27
  this.level = level;
27
28
  }
@@ -29,7 +30,7 @@ var ConsoleLogger = class ConsoleLogger {
29
30
  * Checks if a log level should be output based on the configured minimum level.
30
31
  */
31
32
  shouldLog(level) {
32
- if (this.level === require_types.LogLevel.Silent) return false;
33
+ if (this.level === "silent") return false;
33
34
  return LOG_LEVEL_PRIORITY[level] >= LOG_LEVEL_PRIORITY[this.level];
34
35
  }
35
36
  /**
@@ -45,15 +46,14 @@ var ConsoleLogger = class ConsoleLogger {
45
46
  if (!this.shouldLog(level)) return;
46
47
  const ts = Date.now();
47
48
  if (typeof objOrMsg === "string") {
48
- const logData$1 = {
49
+ logMethod({
49
50
  ...this.data,
50
51
  msg: objOrMsg,
51
52
  ts
52
- };
53
- logMethod(logData$1, ...args);
53
+ }, ...args);
54
54
  return;
55
55
  }
56
- const logData = msg ? {
56
+ logMethod(msg ? {
57
57
  ...this.data,
58
58
  ...objOrMsg,
59
59
  msg,
@@ -62,22 +62,21 @@ var ConsoleLogger = class ConsoleLogger {
62
62
  ...this.data,
63
63
  ...objOrMsg,
64
64
  ts
65
- };
66
- logMethod(logData, ...args);
65
+ }, ...args);
67
66
  };
68
67
  }
69
68
  /** Trace level logging function */
70
- trace = this.createLogFn(console.trace.bind(console), require_types.LogLevel.Trace);
69
+ trace = this.createLogFn(console.trace.bind(console), "trace");
71
70
  /** Debug level logging function */
72
- debug = this.createLogFn(console.debug.bind(console), require_types.LogLevel.Debug);
71
+ debug = this.createLogFn(console.debug.bind(console), "debug");
73
72
  /** Info level logging function */
74
- info = this.createLogFn(console.info.bind(console), require_types.LogLevel.Info);
73
+ info = this.createLogFn(console.info.bind(console), "info");
75
74
  /** Warning level logging function */
76
- warn = this.createLogFn(console.warn.bind(console), require_types.LogLevel.Warn);
75
+ warn = this.createLogFn(console.warn.bind(console), "warn");
77
76
  /** Error level logging function */
78
- error = this.createLogFn(console.error.bind(console), require_types.LogLevel.Error);
77
+ error = this.createLogFn(console.error.bind(console), "error");
79
78
  /** Fatal level logging function (uses console.error) */
80
- fatal = this.createLogFn(console.error.bind(console), require_types.LogLevel.Fatal);
79
+ fatal = this.createLogFn(console.error.bind(console), "fatal");
81
80
  /**
82
81
  * Creates a child logger with additional context data.
83
82
  * The child logger inherits all context from the parent and adds its own.
@@ -142,11 +141,11 @@ const DEFAULT_LOGGER = new ConsoleLogger();
142
141
  * ```
143
142
  */
144
143
  function createLogger(options = {}) {
145
- return new ConsoleLogger({}, options.level ?? require_types.LogLevel.Info);
144
+ return new ConsoleLogger({}, options.level ?? "info");
146
145
  }
147
-
148
146
  //#endregion
149
147
  exports.ConsoleLogger = ConsoleLogger;
150
148
  exports.DEFAULT_LOGGER = DEFAULT_LOGGER;
151
149
  exports.createLogger = createLogger;
150
+
152
151
  //# sourceMappingURL=console.cjs.map
@@ -1 +1 @@
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"}
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,MAAM,qBAA+C;EAClC,UAAA;EACA,UAAA;EACD,SAAA;EACA,SAAA;EACC,UAAA;EACA,UAAA;EACC,WAAA;AACpB;AAEA,IAAa,gBAAb,MAAa,cAAgC;CAUlC;CATV;;;;;;;CAQA,YACC,OAAwB,CAAC,GACzB,QAAA,QACC;EAFQ,KAAA,OAAA;EAGT,KAAK,QAAQ;CACd;;;;CAKA,UAAkB,OAA0B;EAC3C,IAAI,KAAK,UAAA,UACR,OAAO;EAER,OAAO,mBAAmB,UAAU,mBAAmB,KAAK;CAC7D;;;;;;;;;CAUA,YACC,WACA,OACQ;EACR,QACC,UACA,KACA,GAAG,SACO;GACV,IAAI,CAAC,KAAK,UAAU,KAAK,GACxB;GAGD,MAAM,KAAK,KAAK,IAAI;GAGpB,IAAI,OAAO,aAAa,UAAU;IAEjC,UAAU;KADQ,GAAG,KAAK;KAAM,KAAK;KAAU;IAC/B,GAAG,GAAG,IAAI;IAC1B;GACD;GAMA,UAHgB,MACb;IAAE,GAAG,KAAK;IAAM,GAAG;IAAU;IAAK;GAAG,IACrC;IAAE,GAAG,KAAK;IAAM,GAAG;IAAU;GAAG,GAChB,GAAG,IAAI;EAC3B;CACD;;CAGA,QAAe,KAAK,YAAY,QAAQ,MAAM,KAAK,OAAO,GAAA,OAAiB;;CAE3E,QAAe,KAAK,YAAY,QAAQ,MAAM,KAAK,OAAO,GAAA,OAAiB;;CAE3E,OAAc,KAAK,YAAY,QAAQ,KAAK,KAAK,OAAO,GAAA,MAAgB;;CAExE,OAAc,KAAK,YAAY,QAAQ,KAAK,KAAK,OAAO,GAAA,MAAgB;;CAExE,QAAe,KAAK,YAAY,QAAQ,MAAM,KAAK,OAAO,GAAA,OAAiB;;CAE3E,QAAe,KAAK,YAAY,QAAQ,MAAM,KAAK,OAAO,GAAA,OAAiB;;;;;;;;;;;;;;;;CAiB3E,MAAM,KAAqB;EAC1B,OAAO,IAAI,cACV;GACC,GAAG,KAAK;GACR,GAAG;EACJ,GACA,KAAK,KACN;CACD;AACD;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAa,iBAAiB,IAAI,cAAc;;;;;;;;;;;;;;;;;AAkBhD,SAAgB,aAAa,UAA+B,CAAC,GAAW;CACvE,OAAO,IAAI,cAAc,CAAC,GAAG,QAAQ,SAAA,MAAsB;AAC5D"}
@@ -1,7 +1,6 @@
1
- import { CreateLoggerOptions, LogFn, LogLevel, Logger } from "./types-Dk_k2-f_.cjs";
2
-
1
+ import { CreateLoggerOptions, LogFn, LogLevel, Logger } from "./types.cjs";
3
2
  //#region src/console.d.ts
4
- declare class ConsoleLogger implements Logger {
3
+ export declare class ConsoleLogger implements Logger {
5
4
  readonly data: object;
6
5
  private readonly level;
7
6
  /**
@@ -77,7 +76,7 @@ declare class ConsoleLogger implements Logger {
77
76
  * }
78
77
  * ```
79
78
  */
80
- declare const DEFAULT_LOGGER: any;
79
+ export declare const DEFAULT_LOGGER: any;
81
80
  /**
82
81
  * Creates a console logger with the same API as pino's createLogger.
83
82
  *
@@ -94,8 +93,6 @@ declare const DEFAULT_LOGGER: any;
94
93
  * logger.trace('This will NOT be logged (below Debug level)');
95
94
  * ```
96
95
  */
97
- declare function createLogger(options?: CreateLoggerOptions): Logger;
98
- //# sourceMappingURL=console.d.ts.map
96
+ export declare function createLogger(options?: CreateLoggerOptions): Logger;
99
97
  //#endregion
100
- export { ConsoleLogger, DEFAULT_LOGGER, createLogger };
101
98
  //# sourceMappingURL=console.d.cts.map
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"console.d.cts","names":[],"sources":["../src/console.ts"],"mappings":";;qBAgBa,yBAAyB;WAU3B;mBATO;;;;;;;EAQjB,YACU,eACT,QAAO;;;;UAQA;;;;;;;;;UAeA;;EA+BR,OAAO;;EAEP,OAAO;;EAEP,MAAM;;EAEN,MAAM;;EAEN,OAAO;;EAEP,OAAO;;;;;;;;;;;;;;;;EAiBP,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;qBAoCR;;;;;;;;;;;;;;;;;wBAkBG,aAAa,UAAS,sBAA2B"}
@@ -1,7 +1,6 @@
1
- import { CreateLoggerOptions, LogFn, LogLevel, Logger } from "./types-BDdpcrpy.mjs";
2
-
1
+ import { CreateLoggerOptions, LogFn, LogLevel, Logger } from "./types.mjs";
3
2
  //#region src/console.d.ts
4
- declare class ConsoleLogger implements Logger {
3
+ export declare class ConsoleLogger implements Logger {
5
4
  readonly data: object;
6
5
  private readonly level;
7
6
  /**
@@ -77,7 +76,7 @@ declare class ConsoleLogger implements Logger {
77
76
  * }
78
77
  * ```
79
78
  */
80
- declare const DEFAULT_LOGGER: any;
79
+ export declare const DEFAULT_LOGGER: any;
81
80
  /**
82
81
  * Creates a console logger with the same API as pino's createLogger.
83
82
  *
@@ -94,8 +93,6 @@ declare const DEFAULT_LOGGER: any;
94
93
  * logger.trace('This will NOT be logged (below Debug level)');
95
94
  * ```
96
95
  */
97
- declare function createLogger(options?: CreateLoggerOptions): Logger;
98
- //# sourceMappingURL=console.d.ts.map
96
+ export declare function createLogger(options?: CreateLoggerOptions): Logger;
99
97
  //#endregion
100
- export { ConsoleLogger, DEFAULT_LOGGER, createLogger };
101
98
  //# sourceMappingURL=console.d.mts.map
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"console.d.mts","names":[],"sources":["../src/console.ts"],"mappings":";;qBAgBa,yBAAyB;WAU3B;mBATO;;;;;;;EAQjB,YACU,eACT,QAAO;;;;UAQA;;;;;;;;;UAeA;;EA+BR,OAAO;;EAEP,OAAO;;EAEP,MAAM;;EAEN,MAAM;;EAEN,OAAO;;EAEP,OAAO;;;;;;;;;;;;;;;;EAiBP,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;qBAoCR;;;;;;;;;;;;;;;;;wBAkBG,aAAa,UAAS,sBAA2B"}
package/dist/console.mjs CHANGED
@@ -1,19 +1,19 @@
1
- import { LogLevel } from "./types-yQ6XOihF.mjs";
2
-
1
+ import "./types.mjs";
3
2
  //#region src/console.ts
4
3
  /**
5
4
  * Numeric priority for log levels (higher = more severe)
6
5
  */
7
6
  const LOG_LEVEL_PRIORITY = {
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
7
+ ["trace"]: 10,
8
+ ["debug"]: 20,
9
+ ["info"]: 30,
10
+ ["warn"]: 40,
11
+ ["error"]: 50,
12
+ ["fatal"]: 60,
13
+ ["silent"]: 70
15
14
  };
16
15
  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 = LogLevel.Info) {
24
+ constructor(data = {}, level = "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 === LogLevel.Silent) return false;
32
+ if (this.level === "silent") return false;
33
33
  return LOG_LEVEL_PRIORITY[level] >= LOG_LEVEL_PRIORITY[this.level];
34
34
  }
35
35
  /**
@@ -45,15 +45,14 @@ var ConsoleLogger = class ConsoleLogger {
45
45
  if (!this.shouldLog(level)) return;
46
46
  const ts = Date.now();
47
47
  if (typeof objOrMsg === "string") {
48
- const logData$1 = {
48
+ logMethod({
49
49
  ...this.data,
50
50
  msg: objOrMsg,
51
51
  ts
52
- };
53
- logMethod(logData$1, ...args);
52
+ }, ...args);
54
53
  return;
55
54
  }
56
- const logData = msg ? {
55
+ logMethod(msg ? {
57
56
  ...this.data,
58
57
  ...objOrMsg,
59
58
  msg,
@@ -62,22 +61,21 @@ var ConsoleLogger = class ConsoleLogger {
62
61
  ...this.data,
63
62
  ...objOrMsg,
64
63
  ts
65
- };
66
- logMethod(logData, ...args);
64
+ }, ...args);
67
65
  };
68
66
  }
69
67
  /** Trace level logging function */
70
- trace = this.createLogFn(console.trace.bind(console), LogLevel.Trace);
68
+ trace = this.createLogFn(console.trace.bind(console), "trace");
71
69
  /** Debug level logging function */
72
- debug = this.createLogFn(console.debug.bind(console), LogLevel.Debug);
70
+ debug = this.createLogFn(console.debug.bind(console), "debug");
73
71
  /** Info level logging function */
74
- info = this.createLogFn(console.info.bind(console), LogLevel.Info);
72
+ info = this.createLogFn(console.info.bind(console), "info");
75
73
  /** Warning level logging function */
76
- warn = this.createLogFn(console.warn.bind(console), LogLevel.Warn);
74
+ warn = this.createLogFn(console.warn.bind(console), "warn");
77
75
  /** Error level logging function */
78
- error = this.createLogFn(console.error.bind(console), LogLevel.Error);
76
+ error = this.createLogFn(console.error.bind(console), "error");
79
77
  /** Fatal level logging function (uses console.error) */
80
- fatal = this.createLogFn(console.error.bind(console), LogLevel.Fatal);
78
+ fatal = this.createLogFn(console.error.bind(console), "fatal");
81
79
  /**
82
80
  * Creates a child logger with additional context data.
83
81
  * The child logger inherits all context from the parent and adds its own.
@@ -142,9 +140,9 @@ const DEFAULT_LOGGER = new ConsoleLogger();
142
140
  * ```
143
141
  */
144
142
  function createLogger(options = {}) {
145
- return new ConsoleLogger({}, options.level ?? LogLevel.Info);
143
+ return new ConsoleLogger({}, options.level ?? "info");
146
144
  }
147
-
148
145
  //#endregion
149
146
  export { ConsoleLogger, DEFAULT_LOGGER, createLogger };
147
+
150
148
  //# sourceMappingURL=console.mjs.map
@@ -1 +1 @@
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"}
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":";;;;;AAMA,MAAM,qBAA+C;EAClC,UAAA;EACA,UAAA;EACD,SAAA;EACA,SAAA;EACC,UAAA;EACA,UAAA;EACC,WAAA;AACpB;AAEA,IAAa,gBAAb,MAAa,cAAgC;CAUlC;CATV;;;;;;;CAQA,YACC,OAAwB,CAAC,GACzB,QAAA,QACC;EAFQ,KAAA,OAAA;EAGT,KAAK,QAAQ;CACd;;;;CAKA,UAAkB,OAA0B;EAC3C,IAAI,KAAK,UAAA,UACR,OAAO;EAER,OAAO,mBAAmB,UAAU,mBAAmB,KAAK;CAC7D;;;;;;;;;CAUA,YACC,WACA,OACQ;EACR,QACC,UACA,KACA,GAAG,SACO;GACV,IAAI,CAAC,KAAK,UAAU,KAAK,GACxB;GAGD,MAAM,KAAK,KAAK,IAAI;GAGpB,IAAI,OAAO,aAAa,UAAU;IAEjC,UAAU;KADQ,GAAG,KAAK;KAAM,KAAK;KAAU;IAC/B,GAAG,GAAG,IAAI;IAC1B;GACD;GAMA,UAHgB,MACb;IAAE,GAAG,KAAK;IAAM,GAAG;IAAU;IAAK;GAAG,IACrC;IAAE,GAAG,KAAK;IAAM,GAAG;IAAU;GAAG,GAChB,GAAG,IAAI;EAC3B;CACD;;CAGA,QAAe,KAAK,YAAY,QAAQ,MAAM,KAAK,OAAO,GAAA,OAAiB;;CAE3E,QAAe,KAAK,YAAY,QAAQ,MAAM,KAAK,OAAO,GAAA,OAAiB;;CAE3E,OAAc,KAAK,YAAY,QAAQ,KAAK,KAAK,OAAO,GAAA,MAAgB;;CAExE,OAAc,KAAK,YAAY,QAAQ,KAAK,KAAK,OAAO,GAAA,MAAgB;;CAExE,QAAe,KAAK,YAAY,QAAQ,MAAM,KAAK,OAAO,GAAA,OAAiB;;CAE3E,QAAe,KAAK,YAAY,QAAQ,MAAM,KAAK,OAAO,GAAA,OAAiB;;;;;;;;;;;;;;;;CAiB3E,MAAM,KAAqB;EAC1B,OAAO,IAAI,cACV;GACC,GAAG,KAAK;GACR,GAAG;EACJ,GACA,KAAK,KACN;CACD;AACD;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAa,iBAAiB,IAAI,cAAc;;;;;;;;;;;;;;;;;AAkBhD,SAAgB,aAAa,UAA+B,CAAC,GAAW;CACvE,OAAO,IAAI,cAAc,CAAC,GAAG,QAAQ,SAAA,MAAsB;AAC5D"}
package/dist/index.cjs CHANGED
@@ -1,3 +1,3 @@
1
- const require_types = require('./types-ag_0Cvbg.cjs');
2
-
3
- exports.LogLevel = require_types.LogLevel;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_types = require("./types.cjs");
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-Dk_k2-f_.cjs";
2
- export { CreateLoggerOptions, LogFn, LogLevel, Logger, RedactOptions };
1
+ import { CreateLoggerOptions, LogFn, LogLevel, Logger, RedactOptions } from "./types.cjs";
2
+ export { type CreateLoggerOptions, type LogFn, LogLevel, type Logger, type RedactOptions };
package/dist/index.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { CreateLoggerOptions, LogFn, LogLevel, Logger, RedactOptions } from "./types-BDdpcrpy.mjs";
2
- export { CreateLoggerOptions, LogFn, LogLevel, Logger, RedactOptions };
1
+ import { CreateLoggerOptions, LogFn, LogLevel, Logger, RedactOptions } from "./types.mjs";
2
+ export { type CreateLoggerOptions, type LogFn, LogLevel, type Logger, type RedactOptions };
package/dist/index.mjs CHANGED
@@ -1,3 +1,2 @@
1
- import { LogLevel } from "./types-yQ6XOihF.mjs";
2
-
3
- export { LogLevel };
1
+ import { LogLevel } from "./types.mjs";
2
+ export { LogLevel };
package/dist/pino.cjs CHANGED
@@ -1,31 +1,36 @@
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
-
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_redact_paths = require("./redact-paths.cjs");
3
+ let pino = require("pino");
27
4
  //#region src/pino.ts
28
5
  /**
6
+ * Pino logger with built-in redaction support for sensitive data.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * import { createLogger, DEFAULT_REDACT_PATHS } from '@geekmidas/logger/pino';
11
+ *
12
+ * // Enable redaction with sensible defaults
13
+ * const logger = createLogger({ redact: true });
14
+ *
15
+ * // Sensitive data is automatically masked
16
+ * logger.info({ password: 'secret123', user: 'john' }, 'Login');
17
+ * // Output: { password: '[Redacted]', user: 'john' } Login
18
+ *
19
+ * // Add custom paths (merged with defaults)
20
+ * const logger2 = createLogger({ redact: ['user.ssn'] });
21
+ *
22
+ * // Override defaults for full control
23
+ * const logger3 = createLogger({
24
+ * redact: {
25
+ * paths: ['onlyThis'],
26
+ * resolution: 'override',
27
+ * }
28
+ * });
29
+ * ```
30
+ *
31
+ * @module
32
+ */
33
+ /**
29
34
  * Resolves redaction configuration from options.
30
35
  * Returns undefined if redaction is disabled, or a pino-compatible redact config.
31
36
  *
@@ -33,12 +38,11 @@ const pino = __toESM(require("pino"));
33
38
  * With resolution: 'override', only the custom paths are used.
34
39
  */
35
40
  function resolveRedactConfig(redact) {
36
- if (redact === void 0 || redact === false) return void 0;
41
+ if (redact === void 0 || redact === false) return;
37
42
  if (redact === true) return require_redact_paths.DEFAULT_REDACT_PATHS;
38
43
  if (Array.isArray(redact)) return [...require_redact_paths.DEFAULT_REDACT_PATHS, ...redact];
39
44
  const { resolution = "merge", paths, censor, remove } = redact;
40
- const resolvedPaths = resolution === "override" ? paths : [...require_redact_paths.DEFAULT_REDACT_PATHS, ...paths];
41
- const config = { paths: resolvedPaths };
45
+ const config = { paths: resolution === "override" ? paths : [...require_redact_paths.DEFAULT_REDACT_PATHS, ...paths] };
42
46
  if (censor !== void 0) config.censor = censor;
43
47
  if (remove !== void 0) config.remove = remove;
44
48
  return config;
@@ -62,8 +66,7 @@ function resolveRedactConfig(redact) {
62
66
  * ```
63
67
  */
64
68
  function createLogger(options = {}) {
65
- const pretty = options?.pretty && process.NODE_ENV !== "production";
66
- const baseOptions = pretty ? { transport: {
69
+ const baseOptions = options?.pretty && process.NODE_ENV !== "production" ? { transport: {
67
70
  target: "pino-pretty",
68
71
  options: { colorize: true }
69
72
  } } : {};
@@ -82,8 +85,8 @@ function createLogger(options = {}) {
82
85
  }
83
86
  });
84
87
  }
85
-
86
88
  //#endregion
87
89
  exports.DEFAULT_REDACT_PATHS = require_redact_paths.DEFAULT_REDACT_PATHS;
88
90
  exports.createLogger = createLogger;
91
+
89
92
  //# sourceMappingURL=pino.cjs.map
package/dist/pino.cjs.map CHANGED
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"pino.cjs","names":["DEFAULT_REDACT_PATHS"],"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,oBACR,QAC+B;CAC/B,IAAI,WAAW,KAAA,KAAa,WAAW,OACtC;CAGD,IAAI,WAAW,MACd,OAAOA,qBAAAA;CAIR,IAAI,MAAM,QAAQ,MAAM,GACvB,OAAO,CAAC,GAAGA,qBAAAA,sBAAsB,GAAG,MAAM;CAI3C,MAAM,EAAE,aAAa,SAAS,OAAO,QAAQ,WAAW;CAMxD,MAAM,SAA2B,EAAE,OAHlC,eAAe,aAAa,QAAQ,CAAC,GAAGA,qBAAAA,sBAAsB,GAAG,KAAK,EAGf;CACxD,IAAI,WAAW,KAAA,GAAW,OAAO,SAAS;CAC1C,IAAI,WAAW,KAAA,GAAW,OAAO,SAAS;CAE1C,OAAO;AACR;;;;;;;;;;;;;;;;;;;AAoBA,SAAgB,aAAa,UAA+B,CAAC,GAAG;CAG/D,MAAM,cADS,SAAS,UAAU,QAAQ,aAAa,eAEpD,EACA,WAAW;EACV,QAAQ;EACR,SAAS,EAAE,UAAU,KAAK;CAC3B,EACD,IACC,CAAC;CAEJ,MAAM,SAAS,oBAAoB,QAAQ,MAAM;CAEjD,QAAA,GAAO,KAAA,KAAA,CAAK;EACX,GAAG;EACH,GAAI,QAAQ,SAAS,EAAE,OAAO,QAAQ,MAAM;EAC5C,GAAI,UAAU,EAAE,OAAO;EACvB,YAAY;GACX,WAAW;IACV,OAAO,EAAE,aAAa,QAAQ,QAAQ;GACvC;GACA,QAAQ,UAAU;IACjB,OAAO,EAAE,OAAO,MAAM,YAAY,EAAE;GACrC;EACD;CACD,CAAC;AACF"}
package/dist/pino.d.cts CHANGED
@@ -1,9 +1,6 @@
1
- import { CreateLoggerOptions } from "./types-Dk_k2-f_.cjs";
2
- import { DEFAULT_REDACT_PATHS } from "./redact-paths-CsK0_uz-.cjs";
3
- import * as pino0 from "pino";
4
-
1
+ import { CreateLoggerOptions } from "./types.cjs";
2
+ import { DEFAULT_REDACT_PATHS } from "./redact-paths.cjs";
5
3
  //#region src/pino.d.ts
6
-
7
4
  /**
8
5
  * Creates a pino logger instance with optional redaction support.
9
6
  *
@@ -22,8 +19,7 @@ import * as pino0 from "pino";
22
19
  * const devLogger = createLogger({ pretty: true, redact: true });
23
20
  * ```
24
21
  */
25
- declare function createLogger(options?: CreateLoggerOptions): pino0.Logger<never, boolean>;
26
- //# sourceMappingURL=pino.d.ts.map
22
+ export declare function createLogger(options?: CreateLoggerOptions): import("pino").Logger<never, boolean>;
27
23
  //#endregion
28
- export { DEFAULT_REDACT_PATHS, createLogger };
24
+ export { DEFAULT_REDACT_PATHS };
29
25
  //# sourceMappingURL=pino.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pino.d.cts","names":[],"sources":["../src/pino.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAqGA;;;;AAA8D;;;;;;;;;;;iBAA9C,YAAA,WAAsB,sBAAwB,KAAA,CAAA"}
1
+ {"version":3,"file":"pino.d.cts","names":[],"sources":["../src/pino.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;wBAqGgB,aAAa,UAAS,qCAAwB"}
package/dist/pino.d.mts CHANGED
@@ -1,9 +1,6 @@
1
- import { CreateLoggerOptions } from "./types-BDdpcrpy.mjs";
2
- import { DEFAULT_REDACT_PATHS } from "./redact-paths-D07eTMlH.mjs";
3
- import * as pino0 from "pino";
4
-
1
+ import { CreateLoggerOptions } from "./types.mjs";
2
+ import { DEFAULT_REDACT_PATHS } from "./redact-paths.mjs";
5
3
  //#region src/pino.d.ts
6
-
7
4
  /**
8
5
  * Creates a pino logger instance with optional redaction support.
9
6
  *
@@ -22,8 +19,7 @@ import * as pino0 from "pino";
22
19
  * const devLogger = createLogger({ pretty: true, redact: true });
23
20
  * ```
24
21
  */
25
- declare function createLogger(options?: CreateLoggerOptions): pino0.Logger<never, boolean>;
26
- //# sourceMappingURL=pino.d.ts.map
22
+ export declare function createLogger(options?: CreateLoggerOptions): import("pino").Logger<never, boolean>;
27
23
  //#endregion
28
- export { DEFAULT_REDACT_PATHS, createLogger };
24
+ export { DEFAULT_REDACT_PATHS };
29
25
  //# sourceMappingURL=pino.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pino.d.mts","names":[],"sources":["../src/pino.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAqGA;;;;AAA8D;;;;;;;;;;;iBAA9C,YAAA,WAAsB,sBAAwB,KAAA,CAAA"}
1
+ {"version":3,"file":"pino.d.mts","names":[],"sources":["../src/pino.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;wBAqGgB,aAAa,UAAS,qCAAwB"}