@stacksjs/logging 0.72.33 → 0.72.36

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 (2) hide show
  1. package/dist/index.d.ts +38 -1
  2. package/package.json +7 -7
package/dist/index.d.ts CHANGED
@@ -98,7 +98,44 @@ export declare function echo(...args: any[]): Promise<void>;
98
98
  export declare function report(error: unknown, options?: ReportOptions): void;
99
99
  declare function emit(level: 'debug' | 'info' | 'warn' | 'error', event: string, fields: StructuredFields): void;
100
100
  export declare const log: Log;
101
- export declare const struct: unknown;
101
+ /**
102
+ * @defaultValue
103
+ * ```ts
104
+ * {
105
+ * request: (method: string, path: string, status: number, durationMs: number, fields?: StructuredFields) => void,
106
+ * query: (sql: string, durationMs: number, fields?: StructuredFields) => void,
107
+ * slowQuery: (sql: string, durationMs: number, fields?: StructuredFields) => void,
108
+ * job: (name: string, phase: 'started' | 'succeeded' | 'failed' | 'released', fields?: StructuredFields) => void,
109
+ * cache: (op: 'hit' | 'miss' | 'set' | 'del', key: string, fields?: StructuredFields) => void
110
+ * }
111
+ * ```
112
+ */
113
+ export declare const struct: {
114
+ /**
115
+ * HTTP request completed. `status` is the response status code,
116
+ * `durationMs` the wall time from request start to response sent.
117
+ */
118
+ request: (method: string, path: string, status: number, durationMs: number, fields?: StructuredFields) => void;
119
+ /**
120
+ * Database query completed. `durationMs` is the wall time at the
121
+ * driver boundary.
122
+ */
123
+ query: (sql: string, durationMs: number, fields?: StructuredFields) => void;
124
+ /**
125
+ * A slow query (over the slow-threshold) — emits at warn so it
126
+ * surfaces in the default log filter.
127
+ */
128
+ slowQuery: (sql: string, durationMs: number, fields?: StructuredFields) => void;
129
+ /**
130
+ * Queue job lifecycle event. `phase` is `'started' | 'succeeded' |
131
+ * 'failed' | 'released'`.
132
+ */
133
+ job: (name: string, phase: 'started' | 'succeeded' | 'failed' | 'released', fields?: StructuredFields) => void;
134
+ /**
135
+ * Cache hit/miss event for warm-path debugging.
136
+ */
137
+ cache: (op: 'hit' | 'miss' | 'set' | 'del', key: string, fields?: StructuredFields) => void
138
+ };
102
139
  export declare interface ResolvedLogSettings {
103
140
  level: LogLevel
104
141
  format: LogFormat
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@stacksjs/logging",
3
3
  "type": "module",
4
4
  "sideEffects": false,
5
- "version": "0.72.33",
5
+ "version": "0.72.36",
6
6
  "description": "The Stacks logging system.",
7
7
  "author": "Chris Breuer",
8
8
  "contributors": [
@@ -61,12 +61,12 @@
61
61
  "@stacksjs/clarity": "^0.3.33"
62
62
  },
63
63
  "devDependencies": {
64
- "@stacksjs/cli": "0.72.33",
65
- "@stacksjs/config": "0.72.33",
66
- "@stacksjs/error-handling": "0.72.33",
67
- "@stacksjs/path": "0.72.33",
68
- "@stacksjs/storage": "0.72.33",
69
- "@stacksjs/validation": "0.72.33",
64
+ "@stacksjs/cli": "0.72.36",
65
+ "@stacksjs/config": "0.72.36",
66
+ "@stacksjs/error-handling": "0.72.36",
67
+ "@stacksjs/path": "0.72.36",
68
+ "@stacksjs/storage": "0.72.36",
69
+ "@stacksjs/validation": "0.72.36",
70
70
  "better-dx": "^0.2.24"
71
71
  }
72
72
  }