// Copyright © 2020 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
namespace CefSharp.DevTools.Log
{
using System.Linq;
///
/// Provides access to log entries.
///
public partial class Log : DevToolsDomainBase
{
private CefSharp.DevTools.IDevToolsClient _client;
public Log(CefSharp.DevTools.IDevToolsClient client)
{
_client = (client);
}
///
/// Clears the log.
///
/// returns System.Threading.Tasks.Task<DevToolsMethodResponse>
public async System.Threading.Tasks.Task ClearAsync()
{
System.Collections.Generic.Dictionary dict = null;
var methodResult = await _client.ExecuteDevToolsMethodAsync("Log.clear", dict);
return methodResult;
}
///
/// Disables log domain, prevents further log entries from being reported to the client.
///
/// returns System.Threading.Tasks.Task<DevToolsMethodResponse>
public async System.Threading.Tasks.Task DisableAsync()
{
System.Collections.Generic.Dictionary dict = null;
var methodResult = await _client.ExecuteDevToolsMethodAsync("Log.disable", dict);
return methodResult;
}
///
/// Enables log domain, sends the entries collected so far to the client by means of the
/// `entryAdded` notification.
///
/// returns System.Threading.Tasks.Task<DevToolsMethodResponse>
public async System.Threading.Tasks.Task EnableAsync()
{
System.Collections.Generic.Dictionary dict = null;
var methodResult = await _client.ExecuteDevToolsMethodAsync("Log.enable", dict);
return methodResult;
}
partial void ValidateStartViolationsReport(System.Collections.Generic.IList config);
///
/// start violation reporting.
///
/// Configuration for violations.
/// returns System.Threading.Tasks.Task<DevToolsMethodResponse>
public async System.Threading.Tasks.Task StartViolationsReportAsync(System.Collections.Generic.IList config)
{
ValidateStartViolationsReport(config);
var dict = new System.Collections.Generic.Dictionary();
dict.Add("config", config.Select(x => x.ToDictionary()));
var methodResult = await _client.ExecuteDevToolsMethodAsync("Log.startViolationsReport", dict);
return methodResult;
}
///
/// Stop violation reporting.
///
/// returns System.Threading.Tasks.Task<DevToolsMethodResponse>
public async System.Threading.Tasks.Task StopViolationsReportAsync()
{
System.Collections.Generic.Dictionary dict = null;
var methodResult = await _client.ExecuteDevToolsMethodAsync("Log.stopViolationsReport", dict);
return methodResult;
}
}
}