Merge branch 'main' into pr/10

This commit is contained in:
Jonas Kruckenberg 2022-11-16 12:45:23 +01:00
commit baf15ee0cc
12 changed files with 916 additions and 12 deletions

View file

@ -17,6 +17,7 @@ tauri-build = { version = "1.2", features = [] }
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.2", features = ["api-all"] }
tauri-plugin-log = {git = "https://github.com/tauri-apps/tauri-plugin-log", features = ["colored"] }
[features]
# by default Tauri runs in production mode

View file

@ -4,8 +4,8 @@
)]
use std::sync::atomic::{AtomicBool, Ordering};
use tauri::{Manager, State, api::notification::Notification};
use tauri::{Manager, State};
use tauri_plugin_log::{LogTarget, LoggerBuilder};
struct Received(AtomicBool);
// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
@ -21,7 +21,20 @@ fn exit_with_error(e: &str) -> bool {
}
fn main() {
let log_plugin = {
let targets = [
LogTarget::LogDir,
#[cfg(debug_assertions)]
LogTarget::Stdout,
#[cfg(debug_assertions)]
LogTarget::Webview,
];
LoggerBuilder::new().targets(targets).build()
};
tauri::Builder::default()
.plugin(log_plugin)
.invoke_handler(tauri::generate_handler![verify_receive, exit_with_error])
.setup(|app| {
app.manage(Received(AtomicBool::new(false)));