From dc14b108ed4e78e6082a87fe68ad16eca7c8b845 Mon Sep 17 00:00:00 2001 From: exoego Date: Sun, 6 Apr 2025 20:55:12 +0900 Subject: [PATCH] [v2][log]: Add generic fern::Dispatch TargetKind to log Original: https://github.com/tauri-apps/plugins-workspace/pull/1130/commits/b691382d1ea54733ca837995cfac9f82ea05f168 --- plugins/log/src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/log/src/lib.rs b/plugins/log/src/lib.rs index 9bf784c7..9657bcea 100644 --- a/plugins/log/src/lib.rs +++ b/plugins/log/src/lib.rs @@ -170,6 +170,10 @@ pub enum TargetKind { /// /// This requires the webview to subscribe to log events, via this plugins `attachConsole` function. Webview, + /// Send logs to a fern::Dispatch + /// + /// You can use this to construct arbitrary log targets. + Dispatch(fern::Dispatch), } /// A log target. @@ -481,6 +485,7 @@ impl Builder { }); }) } + TargetKind::Dispatch(dispatch) => dispatch.into(), }; target_dispatch = target_dispatch.chain(logger);