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:
@@ -976,24 +976,28 @@
|
||||
return []
|
||||
}
|
||||
|
||||
function writeDebugLog(msg) {
|
||||
try { wailsCall('WriteDebugLog', msg) } catch(e) {}
|
||||
}
|
||||
|
||||
async function acceptTodaySuggestion(s) {
|
||||
try {
|
||||
const eventIds = extractEventIds(s)
|
||||
const eventIdsJSON = JSON.stringify(eventIds)
|
||||
console.log('DEBUG acceptTodaySuggestion:', { nodeId: s.nodeId, eventIds, eventIdsJSON, events: (s.events || []).map(ev => ({ id: ev.id, type: ev.eventType, title: ev.title })) })
|
||||
writeDebugLog('acceptTodaySuggestion: nodeId=' + s.nodeId + ' eventIds=' + eventIdsJSON + ' events=' + JSON.stringify((s.events || []).map(ev => ({ id: ev.id, type: ev.eventType, title: ev.title }))))
|
||||
await wailsCall('AcceptSuggestionWith', s.nodeId, s.summary, s.suggestedMin, '', eventIdsJSON)
|
||||
await refreshAfterSuggestion()
|
||||
} catch (e) { console.error(e) }
|
||||
} catch (e) { writeDebugLog('acceptTodaySuggestion error: ' + e) }
|
||||
}
|
||||
|
||||
async function acceptJournalSuggestion(s) {
|
||||
try {
|
||||
const eventIds = extractEventIds(s)
|
||||
const eventIdsJSON = JSON.stringify(eventIds)
|
||||
console.log('DEBUG acceptJournalSuggestion:', { nodeId: s.nodeId, eventIds, eventIdsJSON, events: (s.events || []).map(ev => ({ id: ev.id, type: ev.eventType, title: ev.title })) })
|
||||
writeDebugLog('acceptJournalSuggestion: nodeId=' + s.nodeId + ' eventIds=' + eventIdsJSON + ' events=' + JSON.stringify((s.events || []).map(ev => ({ id: ev.id, type: ev.eventType, title: ev.title }))))
|
||||
await wailsCall('AcceptSuggestionWith', s.nodeId, s.summary, s.suggestedMin, '', eventIdsJSON)
|
||||
await refreshAfterSuggestion()
|
||||
} catch (e) { console.error(e) }
|
||||
} catch (e) { writeDebugLog('acceptJournalSuggestion error: ' + e) }
|
||||
}
|
||||
|
||||
// ===== Journal =====
|
||||
|
||||
Reference in New Issue
Block a user