[][src]Struct casual_logger::Logger

pub struct Logger {
    pub retention_days: i64,
    pub level: Level,
    pub fatal_timeout_secs: u64,
    pub timeout_secs: u64,
    pub development: bool,
    // some fields omitted
}
👎 Deprecated since 0.4.0:

Please use the casual_logger::Log::xxxx() methods instead

Configuration.

All: 'tic-tac-toe-2020-07-11.log.toml' Prefix: 'tic-tac-toe' StartDate: '-2020-07-11' Suffix: '.log' Extention: '.toml'

If you don't like the .toml extension, leave the suffix empty and the .log extension.

Fields

retention_days: i64
👎 Deprecated since 0.3.8:

Please use the casual_logger::Log::set_retention_days() method instead

File retention days. Delete the file after day from StartDate.

level: Level
👎 Deprecated since 0.3.7:

Please use the casual_logger::Log::set_level() method instead

Activation.

fatal_timeout_secs: u64
👎 Deprecated since 0.3.2:

Please use the casual_logger::Log::set_timeout_secs() method instead

Timeout seconds when fatal.

timeout_secs: u64
👎 Deprecated since 0.3.9:

Please use the casual_logger::Log::set_timeout_secs() method instead

Timeout seconds.

development: bool
👎 Deprecated since 0.3.10:

Please use the casual_logger::Log::set_development() method instead

Set to true to allow Casual_logger to output information to stdout and stderr.

Implementations

impl Logger[src]

pub fn enabled(&self, level: Level) -> bool[src]

Check level.

pub fn get_file_prefix(&self) -> &str[src]

Example:

If 'tic-tac-toe-2020-07-11.log.toml', This is 'tic-tac-toe'.

pub fn get_file_suffix(&self) -> &str[src]

Example:

If 'tic-tac-toe-2020-07-11.log.toml', This is '.log'.

pub fn get_file_extention(&self) -> &str[src]

Example:

If 'tic-tac-toe-2020-07-11.log.toml', This is '.toml'.

pub fn set_file_name(&mut self, prefix: &str, suffix: &str, extention: &str)[src]

👎 Deprecated since 0.3.6:

Please use the casual_logger::Log::set_file_name() or casual_logger::Log::set_toml_ext() method instead

Set name except StartDate.

Example: 'tic-tac-toe-2020-07-11.log.toml'

  • Prefix: 'tic-tac-toe'
  • StartDate: '-2020-07-11'
  • Suffix: '.log'
  • Extention: '.toml'

pub fn remove_old_logs(&self) -> usize[src]

👎 Deprecated since 0.3.3:

Please use the casual_logger::Log::remove_old_logs() method instead

For log rotation.

Trait Implementations

impl Default for Logger[src]

Auto Trait Implementations

impl RefUnwindSafe for Logger

impl Send for Logger

impl Sync for Logger

impl Unpin for Logger

impl UnwindSafe for Logger

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.