Log

Provides access to log entries.

Types

Generally, you do not need to instantiate CDP types yourself. Instead, the API creates objects for you as return values from commands, and then you can use those objects as arguments to other commands.

class cdp.log.LogEntry(source, level, text, timestamp, url=None, line_number=None, stack_trace=None, network_request_id=None, worker_id=None, args=None)

Log entry.

args = None

Call arguments.

level = None

Log entry severity.

line_number = None

Line number in the resource.

network_request_id = None

Identifier of the network request associated with this entry.

source = None

Log entry source.

stack_trace = None

JavaScript stack trace.

text = None

Logged text.

timestamp = None

Timestamp when this entry was added.

url = None

URL of the resource if known.

worker_id = None

Identifier of the worker associated with this entry.

class cdp.log.ViolationSetting(name, threshold)

Violation configuration setting.

name = None

Violation type.

threshold = None

Time threshold to trigger upon.

Commands

Each command is a generator function. The return type Generator[x, y, z] indicates that the generator yields arguments of type x, it must be resumed with an argument of type y, and it returns type z. In this library, types x and y are the same for all commands, and z is the return type you should pay attention to. For more information, see Getting Started: Commands.

cdp.log.clear()

Clears the log.

Return type:Generator[Dict[str, Any], Dict[str, Any], None]
cdp.log.disable()

Disables log domain, prevents further log entries from being reported to the client.

Return type:Generator[Dict[str, Any], Dict[str, Any], None]
cdp.log.enable()

Enables log domain, sends the entries collected so far to the client by means of the entryAdded notification.

Return type:Generator[Dict[str, Any], Dict[str, Any], None]
cdp.log.start_violations_report(config)

start violation reporting.

Parameters:config (List[ViolationSetting]) – Configuration for violations.
Return type:Generator[Dict[str, Any], Dict[str, Any], None]
cdp.log.stop_violations_report()

Stop violation reporting.

Return type:Generator[Dict[str, Any], Dict[str, Any], None]

Events

Generally, you do not need to instantiate CDP events yourself. Instead, the API creates events for you and then you use the event’s attributes.

class cdp.log.EntryAdded(entry)

Issued when new message was logged.

entry = None

The entry.