Skip to main content

DefaultLogger

Struct DefaultLogger 

Source
pub struct DefaultLogger {
    pub program: String,
    pub level: u32,
}
Expand description

Uses the default implementation and outputs to stderr. Carries the program’s invocation name and recursion level for the message prefix.

Fields§

§program: String

The program’s invocation name (argv[0] basename), used as the message prefix like GNU make.

§level: u32

The recursion level (MAKELEVEL); a non-zero level adds a [N] suffix to the prefix.

Trait Implementations§

Source§

impl Clone for DefaultLogger

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Logger for DefaultLogger

By default, print to stderr.

Source§

fn write(&self, msg: String)

Write the formatted message somewhere.
Source§

fn prefix(&self) -> String

The program-name prefix on each message. GNU make uses its own invocation name and, in a sub-make, a [N] recursion-level suffix (e.g. make[1]). The default has no level.
Source§

fn info(&self, msg: &str, context: Option<&Context>)

Log an INFO message.
Source§

fn notice(&self, msg: &str)

Print a build-status notice to stdout with the plain prefix: form and no level tag (e.g. “‘X’ is up to date.” / “Nothing to be done for ‘X’.”), matching GNU make. Distinct from the stderr diagnostic path used by info/warn/error.
Source§

fn warn(&self, msg: &str, context: Option<&Context>)

Log a WARN message.
Source§

fn error(&self, msg: &str, context: Option<&Context>)

Log an ERROR message.
Source§

fn format_log( &self, level: &str, msg: &str, context: Option<&Context>, ) -> String

Formatter for all log messages.

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> 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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.