pub enum TargetKind {
Stdout,
Stderr,
Folder {
path: PathBuf,
file_name: Option<String>,
},
LogDir {
file_name: Option<String>,
},
Webview,
Dispatch(Dispatch),
}
Expand description
An enum representing the available targets of the logger.
Variants§
Stdout
Print logs to stdout.
Stderr
Print logs to stderr.
Folder
Write logs to the given directory.
The plugin will ensure the directory exists before writing logs.
LogDir
Write logs to the OS specific logs directory.
§Platform-specific
Platform | Value | Example |
---|---|---|
Linux | $XDG_DATA_HOME/{bundleIdentifier}/logs or $HOME/.local/share/{bundleIdentifier}/logs | /home/alice/.local/share/com.tauri.dev/logs |
macOS/iOS | {homeDir}/Library/Logs/{bundleIdentifier} | /Users/Alice/Library/Logs/com.tauri.dev |
Windows | {FOLDERID_LocalAppData}/{bundleIdentifier}/logs | C:\Users\Alice\AppData\Local\com.tauri.dev\logs |
Android | {ConfigDir}/logs | /data/data/com.tauri.dev/files/logs |
Webview
Forward logs to the webview (via the log://log
event).
This requires the webview to subscribe to log events, via this plugins attachConsole
function.
Dispatch(Dispatch)
Send logs to a fern::Dispatch
You can use this to construct arbitrary log targets.
Auto Trait Implementations§
impl Freeze for TargetKind
impl !RefUnwindSafe for TargetKind
impl Send for TargetKind
impl !Sync for TargetKind
impl Unpin for TargetKind
impl !UnwindSafe for TargetKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more