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.