Skip to content

Commit

Permalink
fix(localizer): remove logfile (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredallard authored Mar 22, 2022
1 parent aaa8eaf commit 97cf785
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions cmd/localizer/localizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@ package main
import (
"context"
"fmt"
"io"
"os"
"os/signal"
"os/user"
"path/filepath"
"strings"
"syscall"
"time"

"github.com/bombsimon/logrusr/v2"
oapp "github.com/getoutreach/gobox/pkg/app"
Expand Down Expand Up @@ -123,19 +120,6 @@ func main() {
cancel()
}()

// best attempt don't output on --help or --version
if c.Args().First() != "--version" || c.Args().First() != "--help" {
// write to a logfile
tmpFilePath := filepath.Join(os.TempDir(), "localizer-"+strings.ReplaceAll(time.Now().Format(time.RFC3339), ":", "-")+".log")
tmpFile, err := os.Create(tmpFilePath)
if err == nil {
defer tmpFile.Close()

log.Out = io.MultiWriter(os.Stderr, tmpFile)
}
log.WithField("file.path", tmpFilePath).Info("created logfile")
}

if strings.EqualFold(c.String("log-level"), "debug") {
log.SetLevel(logrus.DebugLevel)
}
Expand Down

0 comments on commit 97cf785

Please sign in to comment.