@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.
- package/package.json +1 -1
- package/src/host.mjs +6 -2
package/package.json
CHANGED
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
|
-
|
|
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) {
|