resolve logging

This commit is contained in:
a 2024-06-24 11:51:45 -05:00
parent 38fba5916c
commit e8d2c50cd9
No known key found for this signature in database
GPG key ID: 374BC539FE795AF0

View file

@ -16,7 +16,6 @@ package caddy
import (
"encoding/json"
"flag"
"fmt"
"io"
"log"
@ -700,12 +699,7 @@ type defaultCustomLog struct {
// and enables INFO-level logs and higher.
func newDefaultProductionLog() (*defaultCustomLog, error) {
cl := new(CustomLog)
f := flag.Lookup("test.v")
if (f != nil && f.Value.String() != "true") || strings.Contains(os.Args[0], ".test") {
cl.writerOpener = &DiscardWriter{}
} else {
cl.writerOpener = StderrWriter{}
}
cl.writerOpener = StderrWriter{}
var err error
cl.writer, err = cl.writerOpener.OpenWriter()