Skip to content

Commit dc14b10

Browse files
committed
[v2][log]: Add generic fern::Dispatch TargetKind to log
Original: b691382
1 parent d160991 commit dc14b10

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

plugins/log/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,10 @@ pub enum TargetKind {
170170
///
171171
/// This requires the webview to subscribe to log events, via this plugins `attachConsole` function.
172172
Webview,
173+
/// Send logs to a fern::Dispatch
174+
///
175+
/// You can use this to construct arbitrary log targets.
176+
Dispatch(fern::Dispatch),
173177
}
174178

175179
/// A log target.
@@ -481,6 +485,7 @@ impl Builder {
481485
});
482486
})
483487
}
488+
TargetKind::Dispatch(dispatch) => dispatch.into(),
484489
};
485490
target_dispatch = target_dispatch.chain(logger);
486491

0 commit comments

Comments
 (0)