Skip to content

Commit

Permalink
start changes for logging
Browse files Browse the repository at this point in the history
  • Loading branch information
achhabra2 committed Dec 14, 2021
1 parent d527b21 commit 47b748e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
Binary file modified .DS_Store
Binary file not shown.
8 changes: 1 addition & 7 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,8 @@ func (b *App) startup(ctx context.Context) {
func (b *App) domReady(ctx context.Context) {
// Add your action here
b.UpdateCheckUI()
// buttons := []string{"Yes", "No"}
// dialogOpts := runtime.MessageDialogOptions{Title: "Update Available", Message: "Test", Type: runtime.QuestionDialog, Buttons: buttons, DefaultButton: "Yes", CancelButton: "No"}
// _, err := runtime.MessageDialog(b.ctx, dialogOpts)
// if err != nil {
// runtime.LogError(b.ctx, "Error in update dialog. ")
// }

// err := beeep.Notify("RiftShare", "Send Complete", "./appicon.png")
// err := beeep.Notify("RiftShare", "Send Complete", "/Users/aman/Documents/code/v2-test/appicon.png")
// if err != nil {
// panic(err)
// }
Expand Down
10 changes: 10 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"embed"
"fmt"
"log"
"os"
goruntime "runtime"

"github.com/wailsapp/wails/v2/pkg/options/mac"
Expand Down Expand Up @@ -82,3 +83,12 @@ func GetAppDefaultDimensions() (int, int) {
return 480, 400
}
}

func setupLogs() {
f, err := os.OpenFile("./kqb-json-viewer-output.log", os.O_APPEND|os.O_CREATE|os.O_RDWR, 0666)
if err != nil {
fmt.Printf("error opening file: %v", err)
}

log.SetOutput(f)
}
2 changes: 1 addition & 1 deletion user_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ func openPrefFile() (*os.File, error) {
log.Println(err)
}
return prefs, nil
}
}

0 comments on commit 47b748e

Please sign in to comment.