From 83a44954cd4f33b86c2d533f69f486730dfac99a Mon Sep 17 00:00:00 2001 From: sammy <38820196+TorchedSammy@users.noreply.github.com> Date: Sat, 15 May 2021 09:04:27 -0400 Subject: [PATCH] fix(revert): feat: write errors and panics to tmp log file This reverts commit 1e1b9d07b0ab11ef59d5642ae55943ecf26e7f86. why did i even do this in the first place --- main.go | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/main.go b/main.go index 958ffb5..449409a 100644 --- a/main.go +++ b/main.go @@ -4,11 +4,7 @@ import ( "fmt" "io" "os" - dbg "runtime/debug" "strings" - "strconv" - "syscall" - "io/ioutil" "os/signal" "os/user" "path/filepath" @@ -22,10 +18,9 @@ import ( "golang.org/x/term" ) -var ( - version = "v0.4.1-dev.9" - debug = "false" +var version = "v0.4.1-dev.9" +var ( l *lua.LState prompt string // User's prompt, this will get set when lua side is initialized @@ -62,18 +57,7 @@ func main() { loginshflag := getopt.Lookup('l').Seen() interactiveflag := getopt.Lookup('i').Seen() noexecflag := getopt.Lookup('n').Seen() - debugbool, _ := strconv.ParseBool(debug) - if debugbool { - tmpfile, _ := ioutil.TempFile("", "hilbish*.log") - - // redirects stderr to our tmpfile - // this is for logging panics - err := syscall.Dup2(int(tmpfile.Fd()), int(os.Stderr.Fd())) - if err != nil { - fmt.Println("Failed to redirect stderr to file: %v", err) - } - } if *cmdflag == "" || interactiveflag { interactive = true }