Observed behavior
The docstring on LoopCliConfig.logger in src/types.ts reads:
/**
* Controls verbose diagnostic logging to stderr. Accepts a concrete
* `VerboseLogger` instance, the string `'verbose'` (which creates an
* enabled logger), or `undefined` (quiet, the default).
*/
readonly logger?: LoggerSpec;
This says the field accepts a VerboseLogger instance. But LoggerSpec in src/loggers.ts is defined as:
export type LoggerSpec = Logger | 'verbose' | undefined;
Any object implementing the Logger interface is accepted, not just VerboseLogger. The README and createLogger implementation both treat the field as Logger | 'verbose' | undefined, so callers writing custom loggers will hit no runtime problem; they just see misleading documentation that suggests they have to use VerboseLogger.
Expected behavior
The docstring should describe the field as accepting any Logger implementation (with VerboseLogger mentioned as the built-in option), the string 'verbose', or undefined.
Minimal reproduction
Open src/types.ts and inspect the comment block on the logger field of LoopCliConfig (around line 103), then compare with the LoggerSpec definition in src/loggers.ts.
Suggested fix
Update the docstring to refer to Logger (the public interface) rather than VerboseLogger. For example:
Controls verbose diagnostic logging to stderr. Accepts a concrete
`Logger` instance, the string `'verbose'` (which creates an enabled
`VerboseLogger`), or `undefined` (quiet, the default).
Observed behavior
The docstring on
LoopCliConfig.loggerinsrc/types.tsreads:This says the field accepts a
VerboseLoggerinstance. ButLoggerSpecinsrc/loggers.tsis defined as:Any object implementing the
Loggerinterface is accepted, not justVerboseLogger. The README andcreateLoggerimplementation both treat the field asLogger | 'verbose' | undefined, so callers writing custom loggers will hit no runtime problem; they just see misleading documentation that suggests they have to useVerboseLogger.Expected behavior
The docstring should describe the field as accepting any
Loggerimplementation (withVerboseLoggermentioned as the built-in option), the string'verbose', orundefined.Minimal reproduction
Open
src/types.tsand inspect the comment block on theloggerfield ofLoopCliConfig(around line 103), then compare with theLoggerSpecdefinition insrc/loggers.ts.Suggested fix
Update the docstring to refer to
Logger(the public interface) rather thanVerboseLogger. For example: