*When fetching the logger in the plugin api, return a child instance of the logger instead for that plugin
This commit is contained in:
parent
594e8d82a1
commit
d5138c3860
|
@ -77,7 +77,7 @@ class PluginAPI extends EventEmitter2 {
|
|||
private _logger: Logger;
|
||||
|
||||
get logger(): Logger {
|
||||
return this._logger;
|
||||
throw new Error("not implemented and should not be called");
|
||||
}
|
||||
|
||||
get rpcServer(): RPCServer {
|
||||
|
@ -212,6 +212,10 @@ export class PluginAPIManager {
|
|||
});
|
||||
}
|
||||
|
||||
if (prop === "logger") {
|
||||
return target.logger.child({ plugin: plugin.name });
|
||||
}
|
||||
|
||||
return (target as any)[prop];
|
||||
},
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue