Skip to content

Commit

Permalink
Capture logs while initializing plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
uklotzde committed Mar 17, 2024
1 parent 1a096db commit b018175
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ async fn main() {
let db = plugins::database::setup().await.ok().unwrap();

tauri::Builder::default()
// Logging must be setup first, otherwise the logs won't be captured
// while setting up the other plugins.
.plugin(
tauri_plugin_log::Builder::default()
.targets([
Target::new(TargetKind::Stdout),
Target::new(TargetKind::Webview),
])
.level(LevelFilter::Info)
.with_colors(ColoredLevelConfig::default())
.build(),
)
// Custom integrations
.plugin(plugins::app_menu::init())
.plugin(plugins::config::init())
Expand All @@ -39,16 +51,6 @@ async fn main() {
show_window(&window);
}))
.plugin(tauri_plugin_window_state::Builder::default().build())
.plugin(
tauri_plugin_log::Builder::default()
.targets([
Target::new(TargetKind::Stdout),
Target::new(TargetKind::Webview),
])
.level(LevelFilter::Info)
.with_colors(ColoredLevelConfig::default())
.build(),
)
// TODO: tauri-plugin-theme to update the native theme at runtime
.setup(|_app| {
// :]
Expand Down

0 comments on commit b018175

Please sign in to comment.