Skip to content

Commit

Permalink
fix: remove logging
Browse files Browse the repository at this point in the history
  • Loading branch information
bashbunni committed Aug 10, 2023
1 parent e049e16 commit 2f94d9c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
2 changes: 0 additions & 2 deletions entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package main

import (
"fmt"
"log"
"os"
"os/exec"
"time"
Expand Down Expand Up @@ -139,7 +138,6 @@ func (m *Entry) setViewportContent() {
content = "There are no entries for this project :)"
} else {
file := m.currentFile()
log.Println(file)
content, _ = ReadFile(file)
}
str, _ := glamour.Render(content, "dark")
Expand Down
15 changes: 5 additions & 10 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,13 @@ func main() {
}

func StartTea() {
if path := os.Getenv("DEBUG_PJ"); path != "" {
if f, err := tea.LogToFile(path+"/debug.log", "debug"); err != nil {
fmt.Println("couldn't open file for logging")
if len(os.Getenv("PJ_DEBUG")) > 0 {
f, err := tea.LogToFile("debug.log", "debug")
if err != nil {
fmt.Println("fatal:", err)
os.Exit(1)
} else {
defer func() {
err = f.Close()
if err != nil {
log.Fatal(err)
}
}()
}
defer f.Close()
}

m := InitModel()
Expand Down

0 comments on commit 2f94d9c

Please sign in to comment.