mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-11-23 12:10:21 +00:00
Added debug logging
This commit is contained in:
parent
a6a52989b8
commit
ce302e7b98
@ -1,6 +1,6 @@
|
|||||||
use std::sync::Mutex;
|
use std::sync::Mutex;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use log::{error, info, trace, warn};
|
use log::{debug, error, info, trace, warn};
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
use rocket::{get, post};
|
use rocket::{get, post};
|
||||||
use rocket::serde::json::Json;
|
use rocket::serde::json::Json;
|
||||||
@ -46,8 +46,12 @@ pub fn start_tauri() {
|
|||||||
.build(tauri::generate_context!())
|
.build(tauri::generate_context!())
|
||||||
.expect("Error while running Tauri application");
|
.expect("Error while running Tauri application");
|
||||||
|
|
||||||
app.run(|app_handle, event| match event {
|
app.run(|app_handle, event| {
|
||||||
|
if !matches!(event, tauri::RunEvent::MainEventsCleared) {
|
||||||
|
debug!(Source = "Tauri"; "Event received: {event:?}");
|
||||||
|
}
|
||||||
|
|
||||||
|
match event {
|
||||||
tauri::RunEvent::WindowEvent { event, label, .. } => {
|
tauri::RunEvent::WindowEvent { event, label, .. } => {
|
||||||
match event {
|
match event {
|
||||||
tauri::WindowEvent::CloseRequested { .. } => {
|
tauri::WindowEvent::CloseRequested { .. } => {
|
||||||
@ -68,7 +72,6 @@ pub fn start_tauri() {
|
|||||||
|
|
||||||
tauri::RunEvent::Updater(updater_event) => {
|
tauri::RunEvent::Updater(updater_event) => {
|
||||||
match updater_event {
|
match updater_event {
|
||||||
|
|
||||||
tauri::UpdaterEvent::UpdateAvailable { body, date, version } => {
|
tauri::UpdaterEvent::UpdateAvailable { body, date, version } => {
|
||||||
let body_len = body.len();
|
let body_len = body.len();
|
||||||
info!(Source = "Tauri"; "Updater: update available: body size={body_len} time={date:?} version={version}");
|
info!(Source = "Tauri"; "Updater: update available: body size={body_len} time={date:?} version={version}");
|
||||||
@ -102,7 +105,6 @@ pub fn start_tauri() {
|
|||||||
} else {
|
} else {
|
||||||
warn!(Source = "Tauri"; "Development environment detected; do not restart the app.");
|
warn!(Source = "Tauri"; "Development environment detected; do not restart the app.");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tauri::UpdaterEvent::AlreadyUpToDate => {
|
tauri::UpdaterEvent::AlreadyUpToDate => {
|
||||||
@ -124,6 +126,7 @@ pub fn start_tauri() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_ => {}
|
_ => {}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
warn!(Source = "Tauri"; "Tauri app was stopped.");
|
warn!(Source = "Tauri"; "Tauri app was stopped.");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user