feat: WriteDebugLog binding writes frontend logs to <vault>/.verstak/debug.log
- New cmd/verstak-gui/bindings_debug.go: WriteDebugLog(msg) appends a
timestamped line to the vault's .verstak/debug.log
- Frontend: console.log replaced with writeDebugLog() which calls
wailsCall('WriteDebugLog', ...) — works in production Wails builds
- Both acceptTodaySuggestion and acceptJournalSuggestion log eventIds,
events, and errors to the file
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"time"
|
||||
)
|
||||
|
||||
// WriteDebugLog appends a line to <vault>/.verstak/debug.log.
|
||||
// Called from frontend to log JS-side diagnostics in production GUI builds.
|
||||
func (a *App) WriteDebugLog(msg string) {
|
||||
logPath := filepath.Join(a.vault, ".verstak", "debug.log")
|
||||
line := fmt.Sprintf("[%s] %s\n", time.Now().Format("2006-01-02T15:04:05"), msg)
|
||||
f, err := os.OpenFile(logPath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0o644)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
defer f.Close()
|
||||
f.WriteString(line)
|
||||
}
|
||||
+2
-2
File diff suppressed because one or more lines are too long
@@ -16,7 +16,7 @@
|
||||
background: #13131f;
|
||||
}
|
||||
</style>
|
||||
<script type="module" crossorigin src="/assets/main-BTm9jSp2.js"></script>
|
||||
<script type="module" crossorigin src="/assets/main-DctkOBUz.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/main-BafVhx43.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
Reference in New Issue
Block a user