Enable devtools in release builds + add frontend logging
- Enable Tauri devtools feature so right-click Inspect works in release - Open devtools automatically on launch for debugging - Add log_frontend command: frontend can write to ~/.voicetonotes/frontend.log - Sidecar logs go to %LOCALAPPDATA%/com.voicetonotes.app/sidecar.log - Frontend logs go to %USERPROFILE%/.voicetonotes/frontend.log Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -60,3 +60,18 @@ pub fn llama_list_models() -> Value {
|
||||
pub fn get_data_dir() -> String {
|
||||
LlamaManager::data_dir().to_string_lossy().to_string()
|
||||
}
|
||||
|
||||
/// Log a message from the frontend to a file for debugging.
|
||||
#[tauri::command]
|
||||
pub fn log_frontend(level: String, message: String) {
|
||||
use std::io::Write;
|
||||
let log_path = LlamaManager::data_dir().join("frontend.log");
|
||||
if let Ok(mut file) = std::fs::OpenOptions::new()
|
||||
.create(true)
|
||||
.append(true)
|
||||
.open(&log_path)
|
||||
{
|
||||
let timestamp = chrono::Local::now().format("%Y-%m-%d %H:%M:%S");
|
||||
let _ = writeln!(file, "[{timestamp}] [{level}] {message}");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user