diff --git a/common/frame_session.go b/common/frame_session.go index fbdd85903..e767911da 100644 --- a/common/frame_session.go +++ b/common/frame_session.go @@ -644,11 +644,11 @@ func (fs *FrameSession) onConsoleAPICalled(event *cdpruntime.EventConsoleAPICall WithField("source", "browser"). WithField("browser_source", "console-api") - /* accessing the state Group while not on the eventloop is racy - if s := fs.vu.State(); s.Group.Path != "" { - l = l.WithField("group", s.Group.Path) - } - */ + /* accessing the state Group while not on the eventloop is racy + if s := fs.vu.State(); s.Group.Path != "" { + l = l.WithField("group", s.Group.Path) + } + */ parsedObjects := make([]string, 0, len(event.Args)) for _, robj := range event.Args { @@ -661,18 +661,9 @@ func (fs *FrameSession) onConsoleAPICalled(event *cdpruntime.EventConsoleAPICall msg := strings.Join(parsedObjects, " ") - switch event.Type { - case "log", "info": - l.Info(msg) - case "warning": - l.Warn(msg) - case "error": - l.Error(msg) - default: - // this is where debug & other console.* apis will default to (such as - // console.table). - l.Debug(msg) - } + // this is where debug & other console.* apis will default to (such as + // console.table). + l.Debug(msg) } func (fs *FrameSession) onExceptionThrown(event *cdpruntime.EventExceptionThrown) { @@ -894,21 +885,14 @@ func (fs *FrameSession) onLogEntryAdded(event *cdplog.EventEntryAdded) { WithField("url", event.Entry.URL). WithField("browser_source", event.Entry.Source.String()). WithField("line_number", event.Entry.LineNumber) - /* accessing the state Group while not on the eventloop is racy - if s := fs.vu.State(); s.Group.Path != "" { - l = l.WithField("group", s.Group.Path) - } - */ - switch event.Entry.Level { - case "info": - l.Info(event.Entry.Text) - case "warning": - l.Warn(event.Entry.Text) - case "error": - l.WithField("stacktrace", event.Entry.StackTrace).Error(event.Entry.Text) - default: - l.Debug(event.Entry.Text) + + /* accessing the state Group while not on the eventloop is racy + if s := fs.vu.State(); s.Group.Path != "" { + l = l.WithField("group", s.Group.Path) } + */ + + l.Debug(event.Entry.Text) } func (fs *FrameSession) onPageLifecycle(event *cdppage.EventLifecycleEvent) { diff --git a/common/remote_object.go b/common/remote_object.go index 19bb6f161..d6b027549 100644 --- a/common/remote_object.go +++ b/common/remote_object.go @@ -187,7 +187,7 @@ func valueFromRemoteObject(_ context.Context, robj *cdpruntime.RemoteObject) (an func parseConsoleRemoteObjectPreview(logger *log.Logger, op *cdpruntime.ObjectPreview) (string, error) { obj := make(map[string]string) if op.Overflow { - logger.Infof("parseConsoleRemoteObjectPreview", "object is too large and will be parsed partially") + logger.Debugf("parseConsoleRemoteObjectPreview", "object is too large and will be parsed partially") } for _, p := range op.Properties { @@ -209,7 +209,7 @@ func parseConsoleRemoteObjectPreview(logger *log.Logger, op *cdpruntime.ObjectPr func parseConsoleRemoteArrayPreview(logger *log.Logger, op *cdpruntime.ObjectPreview) (string, error) { arr := make([]any, 0, len(op.Properties)) if op.Overflow { - logger.Infof("parseConsoleRemoteArrayPreview", "array is too large and will be parsed partially") + logger.Debugf("parseConsoleRemoteArrayPreview", "array is too large and will be parsed partially") } for _, p := range op.Properties {