log exec time as debug

This commit is contained in:
Nikita Galaiko 2023-03-22 15:17:10 +01:00
parent e92c924b45
commit c6b23dc250
No known key found for this signature in database
GPG Key ID: EBAB54E845BA519D

View File

@ -106,7 +106,7 @@ fn build_asset_url(path: &str) -> String {
format!("asset://localhost/{}", urlencoding::encode(path)) format!("asset://localhost/{}", urlencoding::encode(path))
} }
#[timed(duration(printer = "info!"))] #[timed(duration(printer = "debug!"))]
async fn proxy_image(handle: tauri::AppHandle, src: &str) -> Result<String> { async fn proxy_image(handle: tauri::AppHandle, src: &str) -> Result<String> {
if src.starts_with("asset://") { if src.starts_with("asset://") {
return Ok(src.to_string()); return Ok(src.to_string());
@ -142,7 +142,7 @@ async fn proxy_image(handle: tauri::AppHandle, src: &str) -> Result<String> {
Ok(build_asset_url(&save_to.display().to_string())) Ok(build_asset_url(&save_to.display().to_string()))
} }
#[timed(duration(printer = "info!"))] #[timed(duration(printer = "debug!"))]
#[tauri::command(async)] #[tauri::command(async)]
async fn search( async fn search(
handle: tauri::AppHandle, handle: tauri::AppHandle,
@ -177,7 +177,7 @@ async fn search(
Ok(deltas) Ok(deltas)
} }
#[timed(duration(printer = "info!"))] #[timed(duration(printer = "debug!"))]
#[tauri::command(async)] #[tauri::command(async)]
async fn list_sessions( async fn list_sessions(
handle: tauri::AppHandle, handle: tauri::AppHandle,
@ -192,7 +192,7 @@ async fn list_sessions(
Ok(sessions) Ok(sessions)
} }
#[timed(duration(printer = "info!"))] #[timed(duration(printer = "debug!"))]
#[tauri::command(async)] #[tauri::command(async)]
async fn get_user(handle: tauri::AppHandle) -> Result<Option<users::User>, Error> { async fn get_user(handle: tauri::AppHandle) -> Result<Option<users::User>, Error> {
let app_state = handle.state::<App>(); let app_state = handle.state::<App>();
@ -222,7 +222,7 @@ async fn get_user(handle: tauri::AppHandle) -> Result<Option<users::User>, Error
} }
} }
#[timed(duration(printer = "info!"))] #[timed(duration(printer = "debug!"))]
#[tauri::command(async)] #[tauri::command(async)]
async fn set_user(handle: tauri::AppHandle, user: users::User) -> Result<(), Error> { async fn set_user(handle: tauri::AppHandle, user: users::User) -> Result<(), Error> {
let app_state = handle.state::<App>(); let app_state = handle.state::<App>();
@ -237,7 +237,7 @@ async fn set_user(handle: tauri::AppHandle, user: users::User) -> Result<(), Err
Ok(()) Ok(())
} }
#[timed(duration(printer = "info!"))] #[timed(duration(printer = "debug!"))]
#[tauri::command(async)] #[tauri::command(async)]
async fn delete_user(handle: tauri::AppHandle) -> Result<(), Error> { async fn delete_user(handle: tauri::AppHandle) -> Result<(), Error> {
let app_state = handle.state::<App>(); let app_state = handle.state::<App>();
@ -252,7 +252,7 @@ async fn delete_user(handle: tauri::AppHandle) -> Result<(), Error> {
Ok(()) Ok(())
} }
#[timed(duration(printer = "info!"))] #[timed(duration(printer = "debug!"))]
#[tauri::command(async)] #[tauri::command(async)]
async fn update_project( async fn update_project(
handle: tauri::AppHandle, handle: tauri::AppHandle,
@ -268,7 +268,7 @@ async fn update_project(
Ok(project) Ok(project)
} }
#[timed(duration(printer = "info!"))] #[timed(duration(printer = "debug!"))]
#[tauri::command(async)] #[tauri::command(async)]
async fn add_project(handle: tauri::AppHandle, path: &str) -> Result<projects::Project, Error> { async fn add_project(handle: tauri::AppHandle, path: &str) -> Result<projects::Project, Error> {
let app_state = handle.state::<App>(); let app_state = handle.state::<App>();
@ -314,7 +314,7 @@ async fn add_project(handle: tauri::AppHandle, path: &str) -> Result<projects::P
Ok(project) Ok(project)
} }
#[timed(duration(printer = "info!"))] #[timed(duration(printer = "debug!"))]
#[tauri::command(async)] #[tauri::command(async)]
async fn list_projects(handle: tauri::AppHandle) -> Result<Vec<projects::Project>, Error> { async fn list_projects(handle: tauri::AppHandle) -> Result<Vec<projects::Project>, Error> {
let app_state = handle.state::<App>(); let app_state = handle.state::<App>();
@ -324,7 +324,7 @@ async fn list_projects(handle: tauri::AppHandle) -> Result<Vec<projects::Project
Ok(projects) Ok(projects)
} }
#[timed(duration(printer = "info!"))] #[timed(duration(printer = "debug!"))]
#[tauri::command(async)] #[tauri::command(async)]
async fn delete_project(handle: tauri::AppHandle, id: &str) -> Result<(), Error> { async fn delete_project(handle: tauri::AppHandle, id: &str) -> Result<(), Error> {
let app_state = handle.state::<App>(); let app_state = handle.state::<App>();
@ -347,7 +347,7 @@ async fn delete_project(handle: tauri::AppHandle, id: &str) -> Result<(), Error>
} }
} }
#[timed(duration(printer = "info!"))] #[timed(duration(printer = "debug!"))]
#[tauri::command(async)] #[tauri::command(async)]
async fn list_session_files( async fn list_session_files(
handle: tauri::AppHandle, handle: tauri::AppHandle,
@ -360,7 +360,7 @@ async fn list_session_files(
Ok(files) Ok(files)
} }
#[timed(duration(printer = "info!"))] #[timed(duration(printer = "debug!"))]
#[tauri::command(async)] #[tauri::command(async)]
async fn list_deltas( async fn list_deltas(
handle: tauri::AppHandle, handle: tauri::AppHandle,
@ -373,7 +373,7 @@ async fn list_deltas(
Ok(deltas) Ok(deltas)
} }
#[timed(duration(printer = "info!"))] #[timed(duration(printer = "debug!"))]
#[tauri::command(async)] #[tauri::command(async)]
async fn git_status( async fn git_status(
handle: tauri::AppHandle, handle: tauri::AppHandle,
@ -384,7 +384,7 @@ async fn git_status(
Ok(files) Ok(files)
} }
#[timed(duration(printer = "info!"))] #[timed(duration(printer = "debug!"))]
#[tauri::command(async)] #[tauri::command(async)]
async fn git_wd_diff( async fn git_wd_diff(
handle: tauri::AppHandle, handle: tauri::AppHandle,
@ -397,7 +397,7 @@ async fn git_wd_diff(
Ok(diff) Ok(diff)
} }
#[timed(duration(printer = "info!"))] #[timed(duration(printer = "debug!"))]
#[tauri::command(async)] #[tauri::command(async)]
async fn git_file_paths(handle: tauri::AppHandle, project_id: &str) -> Result<Vec<String>, Error> { async fn git_file_paths(handle: tauri::AppHandle, project_id: &str) -> Result<Vec<String>, Error> {
let repo = repo_for_project(handle, project_id)?; let repo = repo_for_project(handle, project_id)?;
@ -408,7 +408,7 @@ async fn git_file_paths(handle: tauri::AppHandle, project_id: &str) -> Result<Ve
Ok(files) Ok(files)
} }
#[timed(duration(printer = "info!"))] #[timed(duration(printer = "debug!"))]
#[tauri::command(async)] #[tauri::command(async)]
async fn git_match_paths( async fn git_match_paths(
handle: tauri::AppHandle, handle: tauri::AppHandle,
@ -439,7 +439,7 @@ fn repo_for_project(
Ok(repo) Ok(repo)
} }
#[timed(duration(printer = "info!"))] #[timed(duration(printer = "debug!"))]
#[tauri::command(async)] #[tauri::command(async)]
async fn git_branches(handle: tauri::AppHandle, project_id: &str) -> Result<Vec<String>, Error> { async fn git_branches(handle: tauri::AppHandle, project_id: &str) -> Result<Vec<String>, Error> {
let repo = repo_for_project(handle, project_id)?; let repo = repo_for_project(handle, project_id)?;
@ -449,7 +449,7 @@ async fn git_branches(handle: tauri::AppHandle, project_id: &str) -> Result<Vec<
Ok(files) Ok(files)
} }
#[timed(duration(printer = "info!"))] #[timed(duration(printer = "debug!"))]
#[tauri::command(async)] #[tauri::command(async)]
async fn git_branch(handle: tauri::AppHandle, project_id: &str) -> Result<String, Error> { async fn git_branch(handle: tauri::AppHandle, project_id: &str) -> Result<String, Error> {
let repo = repo_for_project(handle, project_id)?; let repo = repo_for_project(handle, project_id)?;
@ -459,7 +459,7 @@ async fn git_branch(handle: tauri::AppHandle, project_id: &str) -> Result<String
Ok(files) Ok(files)
} }
#[timed(duration(printer = "info!"))] #[timed(duration(printer = "debug!"))]
#[tauri::command(async)] #[tauri::command(async)]
async fn git_switch_branch( async fn git_switch_branch(
handle: tauri::AppHandle, handle: tauri::AppHandle,
@ -473,7 +473,7 @@ async fn git_switch_branch(
Ok(result) Ok(result)
} }
#[timed(duration(printer = "info!"))] #[timed(duration(printer = "debug!"))]
#[tauri::command(async)] #[tauri::command(async)]
async fn git_commit( async fn git_commit(
handle: tauri::AppHandle, handle: tauri::AppHandle,