Struct Builder

Source
pub struct Builder { /* private fields */ }

Implementations§

Source§

impl Builder

Source

pub fn new() -> Self

Source

pub fn rotation_strategy(self, rotation_strategy: RotationStrategy) -> Self

Source

pub fn timezone_strategy(self, timezone_strategy: TimezoneStrategy) -> Self

Source

pub fn max_file_size(self, max_file_size: u128) -> Self

Source

pub fn format<F>(self, formatter: F) -> Self
where F: Fn(FormatCallback<'_>, &Arguments<'_>, &Record<'_>) + Sync + Send + 'static,

Source

pub fn level(self, level_filter: impl Into<LevelFilter>) -> Self

Source

pub fn level_for( self, module: impl Into<Cow<'static, str>>, level: LevelFilter, ) -> Self

Source

pub fn filter<F>(self, filter: F) -> Self
where F: Fn(&Metadata<'_>) -> bool + Send + Sync + 'static,

Source

pub fn clear_targets(self) -> Self

Removes all targets. Useful to ignore the default targets and reconfigure them.

Source

pub fn target(self, target: Target) -> Self

Adds a log target to the logger.

use tauri_plugin_log::{Target, TargetKind};
tauri_plugin_log::Builder::new()
    .target(Target::new(TargetKind::Webview));
Source

pub fn targets(self, targets: impl IntoIterator<Item = Target>) -> Self

Adds a collection of targets to the logger.

use tauri_plugin_log::{Target, TargetKind, WEBVIEW_TARGET};
tauri_plugin_log::Builder::new()
    .clear_targets()
    .targets([
        Target::new(TargetKind::Webview),
        Target::new(TargetKind::LogDir { file_name: Some("webview".into()) }).filter(|metadata| metadata.target().starts_with(WEBVIEW_TARGET)),
        Target::new(TargetKind::LogDir { file_name: Some("rust".into()) }).filter(|metadata| !metadata.target().starts_with(WEBVIEW_TARGET)),
    ]);
Source

pub fn split<R: Runtime>( self, app_handle: &AppHandle<R>, ) -> Result<(TauriPlugin<R>, LevelFilter, Box<dyn Log>), Error>

Source

pub fn build<R: Runtime>(self) -> TauriPlugin<R>

Trait Implementations§

Source§

impl Default for Builder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T