Struct dzahui::logger::DzahuiLogger
source · pub struct DzahuiLogger {
print_to_term: bool,
print_to_file: bool,
tx: SyncSender<String>,
logger_id: &'static str,
}
Expand description
General Information
Logger structure for Dzahui
Fields
print_to_term
- Wether log should be printed to standard exit or notprint_to_file
- Wether log should be written to filetx
- Communication between thread from logs and the rest of Dzahuilogger_id
- String to print on log
Fields§
§print_to_term: bool
§print_to_file: bool
§tx: SyncSender<String>
§logger_id: &'static str
Implementations§
source§impl DzahuiLogger
impl DzahuiLogger
sourcepub fn new(
logger_id: &'static str,
print_to_term: bool,
log_path: Option<PathBuf>
) -> DzahuiLogger
pub fn new(
logger_id: &'static str,
print_to_term: bool,
log_path: Option<PathBuf>
) -> DzahuiLogger
General Information
Creates a new instance of a logger. Will print to term if file is not provided
Parameters
logger_id
- An id for this instanceprint_to_term
- Wether to print to terminal or notlog_path
- Where to store logs
Trait Implementations§
source§impl Log for DzahuiLogger
impl Log for DzahuiLogger
source§fn enabled(&self, metadata: &Metadata<'_>) -> bool
fn enabled(&self, metadata: &Metadata<'_>) -> bool
General Information
Indicates which level of log will be used
Parameters
&self
- to acess method via ‘.’metadata
- to check metadata level
source§fn log(&self, record: &Record<'_>)
fn log(&self, record: &Record<'_>)
General Information
Deals with every log on an individual manner
Parameters
&self
- An instance to check some internal state variablesrecord
- Payload of a log message to record