Skip to content

Logging

Marten Seemann edited this page Jun 11, 2017 · 4 revisions

Launch with env QUIC_GO_LOG_LEVEL=loglevel set, with loglevel "DEBUG", "INFO" or "ERROR". By default logging is disabled.

To write the logs to a file:

f, err := os.Create("./log.txt")
defer f.Close()
if err != nil {
	panic(err)
}
log.SetOutput(f)

or with a buffered Writer:

f, err := os.Create("./log.txt")
defer f.Close()
if err != nil {
	panic(err)
}
log.SetOutput(bufio.NewWriter(f))