mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-28 06:33:47 +03:00
resolve logging
This commit is contained in:
parent
38fba5916c
commit
e8d2c50cd9
1 changed files with 1 additions and 7 deletions
|
@ -16,7 +16,6 @@ package caddy
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"flag"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
|
@ -700,12 +699,7 @@ type defaultCustomLog struct {
|
||||||
// and enables INFO-level logs and higher.
|
// and enables INFO-level logs and higher.
|
||||||
func newDefaultProductionLog() (*defaultCustomLog, error) {
|
func newDefaultProductionLog() (*defaultCustomLog, error) {
|
||||||
cl := new(CustomLog)
|
cl := new(CustomLog)
|
||||||
f := flag.Lookup("test.v")
|
cl.writerOpener = StderrWriter{}
|
||||||
if (f != nil && f.Value.String() != "true") || strings.Contains(os.Args[0], ".test") {
|
|
||||||
cl.writerOpener = &DiscardWriter{}
|
|
||||||
} else {
|
|
||||||
cl.writerOpener = StderrWriter{}
|
|
||||||
}
|
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
cl.writer, err = cl.writerOpener.OpenWriter()
|
cl.writer, err = cl.writerOpener.OpenWriter()
|
||||||
|
|
Loading…
Reference in a new issue