Skip to main content

Logger

Struct Logger 

Source
pub struct Logger { /* private fields */ }
Expand description

Runtime logger for debug and SSH session output.

Implementations§

Source§

impl Logger

Source

pub fn new() -> Self

Construct a logger with both channels disabled.

Source

pub fn enable_debug(&self)

Enable safe debug logging.

Source

pub fn enable_debug_with_verbosity(&self, verbosity: DebugVerbosity)

Enable debug logging with explicit verbosity.

Source

pub fn disable_debug(&self)

Disable debug logging and flush pending messages.

Source

pub fn enable_ssh_logging(&self)

Enable SSH session logging.

Source

pub fn disable_ssh_logging(&self)

Disable SSH session logging.

Source

pub fn debug_verbosity(&self) -> DebugVerbosity

Return currently configured debug verbosity.

Source

pub fn is_debug_enabled(&self) -> bool

Returns true when safe or raw debug is enabled.

Source

pub fn is_raw_debug_enabled(&self) -> bool

Returns true only when raw debug logging is enabled.

Source

pub fn is_ssh_logging_enabled(&self) -> bool

Returns true when SSH session logging is enabled.

Source

pub fn log_debug(&self, message: &str) -> Result<(), LogError>

Write a debug-level message if debug logging is enabled.

Source

pub fn log_info(&self, message: &str) -> Result<(), LogError>

Write an info-level message if debug logging is enabled.

Source

pub fn log_warn(&self, message: &str) -> Result<(), LogError>

Write a warning-level message if debug logging is enabled.

Source

pub fn log_error(&self, message: &str) -> Result<(), LogError>

Write an error-level message if debug logging is enabled.

Source

pub fn flush_debug(&self) -> Result<(), LogError>

Flush debug logger output.

Source

pub fn log_ssh(&self, message: &str) -> Result<(), LogError>

Write one sanitized SSH session log line when enabled.

Source

pub fn log_ssh_raw(&self, message: &str) -> Result<(), LogError>

Write one raw SSH chunk when enabled.

Source

pub fn log_ssh_raw_shared(&self, message: Arc<String>) -> Result<(), LogError>

Write one shared raw SSH chunk without cloning the string.

Source

pub fn flush_ssh(&self) -> Result<(), LogError>

Flush SSH session log output.

Trait Implementations§

Source§

impl Clone for Logger

Source§

fn clone(&self) -> Logger

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for Logger

Source§

fn default() -> Logger

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> TryClone for T
where T: Clone,

Source§

fn try_clone(&self) -> Result<T, Error>

Clones self, possibly returning an error.
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.