[−][src]Struct logosaurus::Logger
Represents a logging object that writes to a specified output. It can be used simultaneously from multiple threads; it guarantees to serialize writes.
Use LoggerBuilder
to construct a Logger
, or use Logger::default()
.
Implementations
impl Logger
[src]
pub fn builder() -> LoggerBuilder
[src]
Returns a LoggerBuilder
that can be used to build a Logger
.
pub fn level(&self) -> LevelFilter
[src]
Returns the current level.
pub fn set_level(&mut self, level: LevelFilter)
[src]
Set the level.
pub fn out(&self) -> Arc<Mutex<Box<dyn Write + Send>>>
[src]
Returns the destination where output will be written.
pub fn set_out(&mut self, out: Box<dyn Write + Send>)
[src]
Set the destination to write output.
pub fn flags(&self) -> Flag
[src]
Returns the current formatting flags.
pub fn set_flags(&mut self, flag: Flag)
[src]
Set the formatting flags.
pub fn prefix(&self) -> &str
[src]
Returns the current ouput prefix.
pub fn set_prefix(&mut self, prefix: &str)
[src]
Set the output prefix.
pub fn write_output(
&self,
level: Level,
target: &str,
file: Option<&str>,
line: Option<u32>,
s: &str
)
[src]
&self,
level: Level,
target: &str,
file: Option<&str>,
line: Option<u32>,
s: &str
)
Writes the given string s
using the logger. Typically, you would not use this directly
but instead use the macros provided by the log
crate.
Trait Implementations
impl Default for Logger
[src]
fn default() -> Logger
[src]
Returns a default Logger
.
A default Logger
has
- level:
log::LevelFilter::Trace
, - out: stderr,
- flags:
L_STD
, and - prefix:
""
(empty string)
impl Log 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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,