diff --git a/src/component/internal/messages.ts b/src/component/internal/messages.ts index 7dbdbcac..91360c8e 100644 --- a/src/component/internal/messages.ts +++ b/src/component/internal/messages.ts @@ -46,10 +46,10 @@ export class NekoMessages extends EventEmitter { private _state: NekoState private _log: Logger - constructor(connection: NekoConnection, state: NekoState) { + constructor(connection: NekoConnection, state: NekoState, logger?: Logger) { super() - this._log = new Logger('messages') + this._log = logger || new Logger('messages') this._state = state this._connection = connection diff --git a/src/component/internal/webrtc.ts b/src/component/internal/webrtc.ts index d8fa79a4..fd36bd91 100644 --- a/src/component/internal/webrtc.ts +++ b/src/component/internal/webrtc.ts @@ -36,10 +36,10 @@ export class NekoWebRTC extends EventEmitter { private _log: Logger private _statsStop?: () => void - constructor() { + constructor(logger?: Logger) { super() - this._log = new Logger('webrtc') + this._log = logger || new Logger('webrtc') } get supported() { diff --git a/src/component/internal/websocket.ts b/src/component/internal/websocket.ts index 3120f1ef..c5159b70 100644 --- a/src/component/internal/websocket.ts +++ b/src/component/internal/websocket.ts @@ -11,10 +11,10 @@ export class NekoWebSocket extends EventEmitter { private _ws?: WebSocket private _log: Logger - constructor() { + constructor(logger?: Logger) { super() - this._log = new Logger('websocket') + this._log = logger || new Logger('websocket') } get supported() {