My question is this package-specific: https://github.com/knq/chromedp/
This is just a glimpse of a log when running chromedp Action
s. It is not event an Action-related piece. What is the correct way to make the logging silent or less verbose?
The solution is simple:
Code taken from their sample:
// create chrome instance
c, err := cdp.New(ctxt, cdp.WithLog(log.Printf))
if err != nil {
log.Fatal(err)
}
change to
// create chrome instance
c, err := cdp.New(ctxt) // no WithLog() option
if err != nil {
log.Fatal(err)
}
Didn't tested
I have no expirience with that package, but accourding the usage example, cbp initialized with the log function:
// create chrome instance
c, err := cdp.New(ctxt, cdp.WithLog(log.Printf)) <- in this case log.Printf
if err != nil {
log.Fatal(err)
}
I assume you can set log level for the log.Printf
with log.SetFlags(0)
// create chrome instance
log.SetFlags(0)
c, err := cdp.New(ctxt, cdp.WithLog(log.Printf))
if err != nil {
log.Fatal(err)
}
or pass an empty function(or initialize without a log function).
There is also Discard
to disable logging at all, log.SetOutput(ioutil.Discard)