Skip to content
Permalink
Browse files

Merge pull request #2057 from giuseppe/no-reopen-stderr

main: not reopen /dev/stderr
  • Loading branch information...
mrunalp committed May 15, 2019
2 parents eb4aeed + 8383c72 commit b9b6cc6e47fe4f2aa4f744a1fc62d248c182d28d
Showing with 8 additions and 2 deletions.
  1. +8 −2 main.go
10 main.go
@@ -87,7 +87,7 @@ func main() {
},
cli.StringFlag{
Name: "log",
Value: "/dev/stderr",
Value: "",
Usage: "set the log file path where internal debug information is written",
},
cli.StringFlag{
@@ -157,9 +157,15 @@ func (f *FatalWriter) Write(p []byte) (n int, err error) {
}

func createLogConfig(context *cli.Context) logs.Config {
logFilePath := context.GlobalString("log")
logPipeFd := ""
if logFilePath == "" {
logPipeFd = "2"
}
config := logs.Config{
LogPipeFd: logPipeFd,
LogLevel: logrus.InfoLevel,
LogFilePath: context.GlobalString("log"),
LogFilePath: logFilePath,
LogFormat: context.GlobalString("log-format"),
}
if context.GlobalBool("debug") {

0 comments on commit b9b6cc6

Please sign in to comment.
You can’t perform that action at this time.