diff --git a/src/modules/plugin.ts b/src/modules/plugin.ts index b970a85..fbc6391 100644 --- a/src/modules/plugin.ts +++ b/src/modules/plugin.ts @@ -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]; }, })