logger callbacklogger custom addcontext
When using a custom logger (a CallbackLogger
), the callback is called with [message:string, level: LogLevel]
and that's it. CallbackLogger
does not override addContext
; its prototype contains Logger.addContext()
which throws away the extra information. This extra information is most certainly useful to someone using a custom logging function.
CallbackLogger.log()
should look like this (changes highlighted):
/**
* Print a log message.
*
* @param message The message itself.
* @param level The urgency of the log message.
*/
override log(message: string, level: LogLevel, ...args: [ts.Node?] | [number, MinimalSourceFile]) { // ๐
super.log(message, level);
this.callback(message, level, ...args); // ๐
}
Hmm, what I suggested was insufficient. It looks like the addContext
method is called, and the string
result is then passed along to the log
and callback
methods. So something more fundamental would need to change in the public API.
The use-case here is programmatic usage of TypeDoc (not plugin implementation).
I'll see if I can find another workaround.
Owner Name | TypeStrong |
Repo Name | typedoc |
Full Name | TypeStrong/typedoc |
Language | TypeScript |
Created Date | 2014-05-24 |
Updated Date | 2023-03-19 |
Star Count | 6487 |
Watcher Count | 68 |
Fork Count | 639 |
Issue Count | 48 |
Issue Title | Created Date | Updated Date |
---|