Struct logging_rs::Logger
source · pub struct Logger {
pub formatter: Formatter,
pub writable_list: Vec<Output>,
}
Expand description
Logger object.
Use Logger::new()
to create logger objects instead of using this struct.
Parameters
formatter
: TheFormatter
to use for formatting messageswritable_list
: A vector ofOutput
s to write to
Returns
A new Logger
object with the specified formatter and writables.
Examples
logging_rs::Logger {
formatter: logging_rs::Formatter::default(),
writable_list: vec![logging_rs::Output::default()]
};
Fields§
§formatter: Formatter
§writable_list: Vec<Output>
Implementations§
source§impl Logger
impl Logger
sourcepub fn new(formatter: Formatter, writable_list: Vec<Output>) -> Logger
pub fn new(formatter: Formatter, writable_list: Vec<Output>) -> Logger
Creates a new logger object.
Parameters
formatter
: TheFormatter
to use for formatting messageswritable_list
: A vector ofOutput
s to write to
Returns
A new Logger
object with the specified formatter and writables.
Examples
logging_rs::Logger::new(logging_rs::Formatter::default(), vec![logging_rs::Output::default()]);
See also
sourcepub fn log(&self, message: &str, level: Level, path: &str)
pub fn log(&self, message: &str, level: Level, path: &str)
Logs the given message.
Parameters
self
: The logger objectmessage
: The message to loglevel
: The logLevel
to use for loggingpath
: The path of the calling file
Returns
A String
containing the formatted message.
Examples
logger.log(
"Some message",
logging_rs::Level::default(),
"src/lib.rs"
);
See also
Trait Implementations§
source§impl Ord for Logger
impl Ord for Logger
source§impl PartialEq for Logger
impl PartialEq for Logger
source§impl PartialOrd for Logger
impl PartialOrd for Logger
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Logger
impl StructuralEq for Logger
impl StructuralPartialEq for Logger
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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more