@jay-framework/logger 0.15.6 → 0.16.1

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/dist/index.d.mts CHANGED
@@ -38,6 +38,8 @@ interface RequestTiming {
38
38
  recordFastRender: (ms: number) => void;
39
39
  /** Record Vite client transform time */
40
40
  recordViteClient: (ms: number) => void;
41
+ /** Add an annotation tag to the timing line (e.g., "[FROZEN]") */
42
+ annotate: (tag: string) => void;
41
43
  /** End the request and print final timing line */
42
44
  end: () => void;
43
45
  }
package/dist/index.mjs CHANGED
@@ -56,12 +56,14 @@ function createDevLogger(level) {
56
56
  parts.push(`vite-client: ${state.viteClient}ms`);
57
57
  const total = Date.now() - state.startTime;
58
58
  const timingStr = parts.length > 0 ? `[${parts.join(" | ")}] ` : "";
59
- return `${state.method} ${state.path} ${timingStr}${total}ms`;
59
+ const ann = state.annotation ? ` ${state.annotation}` : "";
60
+ return `${state.method} ${state.path}${ann} ${timingStr}${total}ms`;
60
61
  }
61
62
  function createTiming(method, path) {
62
63
  const state = {
63
64
  method,
64
65
  path,
66
+ annotation: "",
65
67
  startTime: Date.now(),
66
68
  viteSsr: 0,
67
69
  params: 0,
@@ -101,6 +103,10 @@ function createDevLogger(level) {
101
103
  state.viteClient += ms;
102
104
  updateLine();
103
105
  },
106
+ annotate: (tag) => {
107
+ state.annotation = tag;
108
+ updateLine();
109
+ },
104
110
  end: () => {
105
111
  if (isSilent)
106
112
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jay-framework/logger",
3
- "version": "0.15.6",
3
+ "version": "0.16.1",
4
4
  "license": "Apache-2.0",
5
5
  "main": "dist/index.mjs",
6
6
  "types": "dist/index.d.mts",
@@ -19,7 +19,7 @@
19
19
  "test:watch": "vitest"
20
20
  },
21
21
  "devDependencies": {
22
- "@jay-framework/dev-environment": "^0.15.6",
22
+ "@jay-framework/dev-environment": "^0.16.1",
23
23
  "@types/node": "^20.11.5",
24
24
  "rimraf": "^5.0.5",
25
25
  "tsup": "^8.0.1",