refactor: Add logger

This commit is contained in:
Kevin Yue
2023-05-23 14:30:20 +08:00
parent cbd8b0f144
commit 462428f99a
15 changed files with 430 additions and 91 deletions

View File

@@ -15,15 +15,18 @@ rust-version = "1.59"
tauri-build = { version = "1.2.1", features = [] }
[dependencies]
tauri = { version = "1.2.4", features = ["http-all"] }
tauri-plugin-log = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" }
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.2.4", features = ["http-all"] }
log = "0.4"
env_logger = "0.10"
common = { path = "../../common" }
[features]
# by default Tauri runs in production mode
# when `tauri dev` runs it is executed with `cargo run --no-default-features` if `devPath` is an URL
default = [ "custom-protocol" ]
default = ["custom-protocol"]
# this feature is used for production builds where `devPath` points to the filesystem
# DO NOT remove this
custom-protocol = [ "tauri/custom-protocol" ]
custom-protocol = ["tauri/custom-protocol"]

View File

@@ -4,6 +4,7 @@
)]
use common::{Client, ServerApiError, VpnStatus};
use env_logger::Env;
use serde::Serialize;
use std::sync::Arc;
use tauri::{Manager, State};
@@ -53,6 +54,8 @@ fn setup(app: &mut tauri::App) -> Result<(), Box<dyn std::error::Error>> {
}
fn main() {
env_logger::Builder::from_env(Env::default().default_filter_or("info")).init();
tauri::Builder::default()
.setup(setup)
.invoke_handler(tauri::generate_handler![