From 97cf78537b0e460b3b2afe585ad03ef4261c51cc Mon Sep 17 00:00:00 2001 From: Jared Allard Date: Mon, 21 Mar 2022 17:16:03 -0700 Subject: [PATCH] fix(localizer): remove logfile (#186) --- cmd/localizer/localizer.go | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/cmd/localizer/localizer.go b/cmd/localizer/localizer.go index 73a1733..659c298 100644 --- a/cmd/localizer/localizer.go +++ b/cmd/localizer/localizer.go @@ -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" @@ -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) }