Skip to content

Commit

Permalink
cmd/kail: fix -h on osx
Browse files Browse the repository at this point in the history
fixes #29
  • Loading branch information
boz committed May 16, 2019
1 parent 2ecc674 commit bb96ae6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/kail/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ var (

flagLogFile = kingpin.Flag("log-file", "log file output").
Default("/dev/stderr").
OpenFile(os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0644)
String()

flagLogLevel = kingpin.Flag("log-level", "log level").
Default("error").
Expand Down Expand Up @@ -157,9 +157,12 @@ func createLog() logutil.Log {
lvl, err := logrus.ParseLevel(*flagLogLevel)
kingpin.FatalIfError(err, "Invalid log level")

file, err := os.OpenFile(*flagLogFile, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0644)
kingpin.FatalIfError(err, "Error opening log file")

parent := logrus.New()
parent.Level = lvl
parent.Out = *flagLogFile
parent.Out = file

// XXX: fucking glog.
os.Args = []string{os.Args[0],
Expand Down

0 comments on commit bb96ae6

Please sign in to comment.