CDPotion.Domain.Log (cdpotion v0.1.4)

Summary

Types

Log entry.

Violation configuration setting.

Functions

Clears the log.

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

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

start violation reporting.

Stop violation reporting.

Types

@type log_entry() :: %{
  args: [CDPotion.Domain.Runtime.remote_object()] | nil,
  category: :cors | nil,
  level: :verbose | :info | :warning | :error,
  lineNumber: integer() | nil,
  networkRequestId: CDPotion.Domain.Network.request_id() | nil,
  source:
    :xml
    | :javascript
    | :network
    | :storage
    | :appcache
    | :rendering
    | :security
    | :deprecation
    | :worker
    | :violation
    | :intervention
    | :recommendation
    | :other,
  stackTrace: CDPotion.Domain.Runtime.stack_trace() | nil,
  text: String.t(),
  timestamp: CDPotion.Domain.Runtime.timestamp(),
  url: String.t() | nil,
  workerId: String.t() | nil
}

Log entry.

Link to this type

violation_setting()

@type violation_setting() :: %{
  name:
    :longTask
    | :longLayout
    | :blockedEvent
    | :blockedParser
    | :discouragedAPIUse
    | :handler
    | :recurringHandler,
  threshold: number()
}

Violation configuration setting.

Functions

@spec clear() :: {String.t(), map()}

Clears the log.

@spec disable() :: {String.t(), map()}

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

@spec enable() :: {String.t(), map()}

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

Link to this function

start_violations_report(config)

@spec start_violations_report([violation_setting()]) :: {String.t(), map()}

start violation reporting.

Parameters:

  • (Required) config: Configuration for violations.
Link to this function

stop_violations_report()

@spec stop_violations_report() :: {String.t(), map()}

Stop violation reporting.