Replies: 1 comment
|
At tag |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
While building a logging plugin (dsh-logbook, #5138) I ran into two reproducible problems in the cordis logger that affect every plugin that logs. Both verified today on
@deepseek-ai/cordis4.0.2 from npm and present unchanged invendor/cordis/src/logger.tson master.1.
ctx.logger.warnnever reaches the in-memory bufferThe levels are error=0, info=1, warn=2, debug=3, and an exporter receives a message when its threshold is at least the message level (
logger.ts, the_methoddispatch). The built-in buffer exporter registers nolevelsmap, so the threshold falls back to the logger default of 1, and everywarnanddebugrecord is skipped. Since no shipped profile mounts any other exporter, a plugin's warning currently goes nowhere at all, not even into memory.One minute to reproduce:
Suggested fix: give the buffer exporter an explicit
levels: { default: 3 }so the buffer keeps everything (it is already bounded to 1000 records), or raise the fallback for the buffer specifically. As a side note, with info=1 below warn=2, a single numeric threshold cannot express "warnings and errors only", which is the filter most log sinks want; worth considering when touching this area.2. Disposing an exporter removes the most recently registered exporter, not its own
LoggerService.exporter()registers under++this._snExporterbut the returned disposer deletesthis._snExporterread at dispose time:So whenever two plugins have registered exporters, unloading or hot-reloading the first one silently detaches the second plugin's log sink while the first keeps exporting. Reproduce:
I think this line would fix it: capture the key at registration (
const sn = ++this._snExporter; this.exporters.set(sn, exporter); return () => this.exporters.delete(sn)).Impact: any two plugins from the growing set that register exporters (dsh-logger-panel, dsh-boot-doctor, dsh-logbook, and every plugin that prints its own lines) can silently break each other's logging on reload. dsh-logbook works around both bugs (it registers a full-capture exporter and keeps an inert flag against stale copies), but the fixes belong upstream.
Happy to provide anything else that helps. Thank you for providing and developing the harness!
> Posted by a community member; findings verified against cordis 4.0.2 and master as of 2026-08-30.
All reactions