@iasiv5/dsh-quota-watch 0.1.22 → 0.1.23

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/package.json +1 -1
  2. package/src/host.mjs +6 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iasiv5/dsh-quota-watch",
3
- "version": "0.1.22",
3
+ "version": "0.1.23",
4
4
  "description": "DSH Web sidebar monitor for GLM Coding Plan quotas and GitHub Copilot credits",
5
5
  "type": "module",
6
6
  "main": "./src/host.mjs",
package/src/host.mjs CHANGED
@@ -147,12 +147,16 @@ export function createQuotaService(ctx, options = {}) {
147
147
  }
148
148
  }
149
149
 
150
- /** Log one real state transition; degradations warn, recoveries and missing-credentials inform. */
150
+ /** Log one real state transition; degradations warn, recoveries and missing-credentials inform.
151
+ * Dual-channel: ctx.logger (cordis, ring-buffer only — the host registers no journal
152
+ * exporter) mirrored to console so service stdout lands in journald. */
151
153
  function logTransition(key, from, to, detail) {
152
154
  if (from === to) return
153
155
  const line = `quota-watch: ${key} ${from}→${to}${detail ? ` (${detail})` : ''}`
154
- if (to === 'error' || to === 'stale') ctx.logger?.warn?.(line)
156
+ const level = to === 'error' || to === 'stale' ? 'warn' : 'info'
157
+ if (level === 'warn') ctx.logger?.warn?.(line)
155
158
  else ctx.logger?.info?.(line)
159
+ ;(options.logMirror ?? console)[level]?.(line)
156
160
  }
157
161
 
158
162
  function markMissing(key, displayName) {