mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
pass optional logger instance to constructor.
This commit is contained in:
parent
ce88143903
commit
f067fe9d62
@ -46,10 +46,10 @@ export class NekoMessages extends EventEmitter<NekoEvents> {
|
|||||||
private _state: NekoState
|
private _state: NekoState
|
||||||
private _log: Logger
|
private _log: Logger
|
||||||
|
|
||||||
constructor(connection: NekoConnection, state: NekoState) {
|
constructor(connection: NekoConnection, state: NekoState, logger?: Logger) {
|
||||||
super()
|
super()
|
||||||
|
|
||||||
this._log = new Logger('messages')
|
this._log = logger || new Logger('messages')
|
||||||
this._state = state
|
this._state = state
|
||||||
this._connection = connection
|
this._connection = connection
|
||||||
|
|
||||||
|
@ -36,10 +36,10 @@ export class NekoWebRTC extends EventEmitter<NekoWebRTCEvents> {
|
|||||||
private _log: Logger
|
private _log: Logger
|
||||||
private _statsStop?: () => void
|
private _statsStop?: () => void
|
||||||
|
|
||||||
constructor() {
|
constructor(logger?: Logger) {
|
||||||
super()
|
super()
|
||||||
|
|
||||||
this._log = new Logger('webrtc')
|
this._log = logger || new Logger('webrtc')
|
||||||
}
|
}
|
||||||
|
|
||||||
get supported() {
|
get supported() {
|
||||||
|
@ -11,10 +11,10 @@ export class NekoWebSocket extends EventEmitter<NekoWebSocketEvents> {
|
|||||||
private _ws?: WebSocket
|
private _ws?: WebSocket
|
||||||
private _log: Logger
|
private _log: Logger
|
||||||
|
|
||||||
constructor() {
|
constructor(logger?: Logger) {
|
||||||
super()
|
super()
|
||||||
|
|
||||||
this._log = new Logger('websocket')
|
this._log = logger || new Logger('websocket')
|
||||||
}
|
}
|
||||||
|
|
||||||
get supported() {
|
get supported() {
|
||||||
|
Loading…
Reference in New Issue
Block a user