import*as Host from"../host/host.js";import{Capability,SDKModel}from"./SDKModel.js";export class LogModel extends SDKModel{constructor(o){super(o),o.registerLogDispatcher(this),this._logAgent=o.logAgent(),this._logAgent.invoke_enable(),Host.InspectorFrontendHost.isUnderTest()||this._logAgent.invoke_startViolationsReport({config:[{name:Protocol.Log.ViolationSettingName.LongTask,threshold:200},{name:Protocol.Log.ViolationSettingName.LongLayout,threshold:30},{name:Protocol.Log.ViolationSettingName.BlockedEvent,threshold:100},{name:Protocol.Log.ViolationSettingName.BlockedParser,threshold:-1},{name:Protocol.Log.ViolationSettingName.Handler,threshold:150},{name:Protocol.Log.ViolationSettingName.RecurringHandler,threshold:50},{name:Protocol.Log.ViolationSettingName.DiscouragedAPIUse,threshold:-1}]})}entryAdded({entry:o}){this.dispatchEventToListeners(Events.EntryAdded,{logModel:this,entry:o})}requestClear(){this._logAgent.invoke_clear()}}export const Events={EntryAdded:Symbol("EntryAdded")};SDKModel.register(LogModel,Capability.Log,!0);