log

package
v0.0.0-...-b9fffb6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2025 License: MIT Imports: 6 Imported by: 53

Documentation

Overview

Package log provides the Chrome DevTools Protocol commands, types, and events for the Log domain.

Provides access to log entries.

Generated by the cdproto-gen command.

Index

Constants

View Source
const (
	CommandClear                 = "Log.clear"
	CommandDisable               = "Log.disable"
	CommandEnable                = "Log.enable"
	CommandStartViolationsReport = "Log.startViolationsReport"
	CommandStopViolationsReport  = "Log.stopViolationsReport"
)

Command names.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClearParams

type ClearParams struct{}

ClearParams clears the log.

func (*ClearParams) Do

func (p *ClearParams) Do(ctx context.Context) (err error)

Do executes Log.clear against the provided context.

type DisableParams

type DisableParams struct{}

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

func Disable

func Disable() *DisableParams

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

See: https://chromedevtools.github.io/devtools-protocol/tot/Log#method-disable

func (*DisableParams) Do

func (p *DisableParams) Do(ctx context.Context) (err error)

Do executes Log.disable against the provided context.

type EnableParams

type EnableParams struct{}

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

func Enable

func Enable() *EnableParams

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

See: https://chromedevtools.github.io/devtools-protocol/tot/Log#method-enable

func (*EnableParams) Do

func (p *EnableParams) Do(ctx context.Context) (err error)

Do executes Log.enable against the provided context.

type Entry

type Entry struct {
	Source           Source                  `json:"source"` // Log entry source.
	Level            Level                   `json:"level"`  // Log entry severity.
	Text             string                  `json:"text"`   // Logged text.
	Category         EntryCategory           `json:"category,omitempty,omitzero"`
	Timestamp        *runtime.Timestamp      `json:"timestamp"`                           // Timestamp when this entry was added.
	URL              string                  `json:"url,omitempty,omitzero"`              // URL of the resource if known.
	LineNumber       int64                   `json:"lineNumber,omitempty,omitzero"`       // Line number in the resource.
	StackTrace       *runtime.StackTrace     `json:"stackTrace,omitempty,omitzero"`       // JavaScript stack trace.
	NetworkRequestID network.RequestID       `json:"networkRequestId,omitempty,omitzero"` // Identifier of the network request associated with this entry.
	WorkerID         string                  `json:"workerId,omitempty,omitzero"`         // Identifier of the worker associated with this entry.
	Args             []*runtime.RemoteObject `json:"args,omitempty,omitzero"`             // Call arguments.
}

Entry log entry.

See: https://chromedevtools.github.io/devtools-protocol/tot/Log#type-LogEntry

type EntryCategory

type EntryCategory string

EntryCategory [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/Log#type-LogEntry

const (
	EntryCategoryCors EntryCategory = "cors"
)

EntryCategory values.

func (EntryCategory) String

func (t EntryCategory) String() string

String returns the EntryCategory as string value.

func (*EntryCategory) UnmarshalJSON

func (t *EntryCategory) UnmarshalJSON(buf []byte) error

UnmarshalJSON satisfies [json.Unmarshaler].

type EventEntryAdded

type EventEntryAdded struct {
	Entry *Entry `json:"entry"` // The entry.
}

EventEntryAdded issued when new message was logged.

See: https://chromedevtools.github.io/devtools-protocol/tot/Log#event-entryAdded

type Level

type Level string

Level log entry severity.

See: https://chromedevtools.github.io/devtools-protocol/tot/Log#type-LogEntry

const (
	LevelVerbose Level = "verbose"
	LevelInfo    Level = "info"
	LevelWarning Level = "warning"
	LevelError   Level = "error"
)

Level values.

func (Level) String

func (t Level) String() string

String returns the Level as string value.

func (*Level) UnmarshalJSON

func (t *Level) UnmarshalJSON(buf []byte) error

UnmarshalJSON satisfies [json.Unmarshaler].

type Source

type Source string

Source log entry source.

See: https://chromedevtools.github.io/devtools-protocol/tot/Log#type-LogEntry

const (
	SourceXML            Source = "xml"
	SourceJavascript     Source = "javascript"
	SourceNetwork        Source = "network"
	SourceStorage        Source = "storage"
	SourceAppcache       Source = "appcache"
	SourceRendering      Source = "rendering"
	SourceSecurity       Source = "security"
	SourceDeprecation    Source = "deprecation"
	SourceWorker         Source = "worker"
	SourceViolation      Source = "violation"
	SourceIntervention   Source = "intervention"
	SourceRecommendation Source = "recommendation"
	SourceOther          Source = "other"
)

Source values.

func (Source) String

func (t Source) String() string

String returns the Source as string value.

func (*Source) UnmarshalJSON

func (t *Source) UnmarshalJSON(buf []byte) error

UnmarshalJSON satisfies [json.Unmarshaler].

type StartViolationsReportParams

type StartViolationsReportParams struct {
	Config []*ViolationSetting `json:"config"` // Configuration for violations.
}

StartViolationsReportParams start violation reporting.

func StartViolationsReport

func StartViolationsReport(config []*ViolationSetting) *StartViolationsReportParams

StartViolationsReport start violation reporting.

See: https://chromedevtools.github.io/devtools-protocol/tot/Log#method-startViolationsReport

parameters:

config - Configuration for violations.

func (*StartViolationsReportParams) Do

Do executes Log.startViolationsReport against the provided context.

type StopViolationsReportParams

type StopViolationsReportParams struct{}

StopViolationsReportParams stop violation reporting.

func StopViolationsReport

func StopViolationsReport() *StopViolationsReportParams

StopViolationsReport stop violation reporting.

See: https://chromedevtools.github.io/devtools-protocol/tot/Log#method-stopViolationsReport

func (*StopViolationsReportParams) Do

Do executes Log.stopViolationsReport against the provided context.

type Violation

type Violation string

Violation violation type.

See: https://chromedevtools.github.io/devtools-protocol/tot/Log#type-ViolationSetting

const (
	ViolationLongTask          Violation = "longTask"
	ViolationLongLayout        Violation = "longLayout"
	ViolationBlockedEvent      Violation = "blockedEvent"
	ViolationBlockedParser     Violation = "blockedParser"
	ViolationDiscouragedAPIUse Violation = "discouragedAPIUse"
	ViolationHandler           Violation = "handler"
	ViolationRecurringHandler  Violation = "recurringHandler"
)

Violation values.

func (Violation) String

func (t Violation) String() string

String returns the Violation as string value.

func (*Violation) UnmarshalJSON

func (t *Violation) UnmarshalJSON(buf []byte) error

UnmarshalJSON satisfies [json.Unmarshaler].

type ViolationSetting

type ViolationSetting struct {
	Name      Violation `json:"name"`      // Violation type.
	Threshold float64   `json:"threshold"` // Time threshold to trigger upon.
}

ViolationSetting violation configuration setting.

See: https://chromedevtools.github.io/devtools-protocol/tot/Log#type-ViolationSetting

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL