jslog

package
v0.0.0-...-9474aff Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package jslog provides JavaScript console logger for chrome package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregator

type Aggregator struct {
	// contains filtered or unexported fields
}

Aggregator records JavaScript console logs across multiple DevTool targets, and saves them as a single text file suitable for inspection.

func NewAggregator

func NewAggregator() *Aggregator

NewAggregator creates a new Aggregator and starts a background goroutine to collect log entries from workers. On cleanup, Close must be called to stop the background goroutine.

func (*Aggregator) Close

func (a *Aggregator) Close()

Close stops the background goroutine to collect logs from workers. This method does not wait for workers to stop.

func (*Aggregator) NewWorker

func (a *Aggregator) NewWorker(targetID, initURL string, ev runtime.ConsoleAPICalledClient) *Worker

NewWorker creates a Worker that collects JavaScript console logs of a target.

func (*Aggregator) Save

func (a *Aggregator) Save(path string) error

Save saves the collected logs to path as a single text file. Logs in memory are cleared when this method successfully returns.

type Worker

type Worker struct {
	// contains filtered or unexported fields
}

Worker collects JavaScript console logs of a target. Collected logs are sent to Aggregator via logCh.

func (*Worker) Close

func (w *Worker) Close()

Close closes the stream to receive console API notifications. Once this method returns, you can assume all logs are flushed to Aggregator.

func (*Worker) Report

func (w *Worker) Report(ts time.Time, typ, msg string, stack *runtime.StackTrace)

Report sends a log to Aggregator. This method can be called from Conn to Report eval failures.

Jump to

Keyboard shortcuts

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