// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the Microsoft Software License Terms for the Azure Communications Services, Azure CPaaS, MICROSOFT AZURE COMMUNICATION CALLING EFFECTS
// See LICENSE file for license information.

import{EventEmitter as e}from"events";class EventEmitterImpl extends e{constructor(e,t){super(),this.options={enableLogOnSubscribe:!0,enableLogOnUnsubscribe:!0,enableLogOnSubscribeOnce:!0,enableLogOnEmit:!0},this.logger=e.createChild("EffectsEventEmitter"),t&&(this.options=t)}on(e,t){return this.options.enableLogOnSubscribe&&this.logger.info(`event:subscribe to ${e.toString()}`),super.on(e,t)}once(e,t){return this.options.enableLogOnSubscribeOnce&&this.logger.info(`event:subscribe once to ${e.toString()}`),super.once(e,t)}off(e,t){return this.options.enableLogOnUnsubscribe&&this.logger.info(`event:unsubscribed ${e.toString()}`),super.off(e,t)}emit(e,...t){return this.options.enableLogOnEmit&&this.logger.info(`event:emit ${e.toString()}`),super.emit(e,...t)}}export{EventEmitterImpl};
