pub fn log(&self, record: &Record, logger: &NitroLogger) {
        let mut writers = Vec::new();
        for target in self.targets.iter() {
            if let Ok(value) = target.start_write(record) {
                writers.push(value);
            }
        }
        for values in &self.format.format {
            match values {
                FormatSection::Text(value) => {
                    self.write(&mut writers, value.as_bytes(), logger);
                }
                FormatSection::Variable(variable) => {
                    self.write(&mut writers, variable.get_value(record.key_values()).as_bytes(), logger)
                }
                FormatSection::Placeholder(placeholder) => {
                    self.write(
                        &mut writers,
                        placeholder.build_message(record).as_bytes(),
                        logger,
                    );
                }
            }
        }
        let mut writers = if self.structure_dump {
            let mut dump = DefaultStructureDump { write: writers };
            record.key_values().visit(&mut dump).unwrap();
            dump.write
        } else {
            writers
        };

        self.write(&mut writers, "\n".as_bytes(), logger);

        for mut writer in writers.into_iter() {
            if let Err(error) = writer.flush() {
                (logger.error_handler)(&anyhow::Error::from(error));
            }
            if let Err(error) = writer.logger.return_write(writer) {
                (logger.error_handler)(&error);
            }
        }
    }
/// Logs a record
/// Handling Formatting and the internal writers
Logs a record
Handling Formatting and the internal writers
Logs a record Handling Formatting and the internal writers
pub fn log(&self, record: &Record, logger: &NitroLogger) {
        let mut writers = Vec::new();
        for target in self.targets.iter() {
            if let Ok(value) = target.start_write(record) {
                writers.push(value);
            }
        }
        for values in &self.format.format {
            match values {
                FormatSection::Text(value) => {
                    self.write(&mut writers, value.as_bytes(), logger);
                }
                FormatSection::Variable(variable) => {
                    self.write(&mut writers, variable.get_value(record.key_values()).as_bytes(), logger)
                }
                FormatSection::Placeholder(placeholder) => {
                    self.write(
                        &mut writers,
                        placeholder.build_message(record).as_bytes(),
                        logger,
                    );
                }
            }
        }
        let mut writers = if self.structure_dump {
            let mut dump = DefaultStructureDump { write: writers };
            record.key_values().visit(&mut dump).unwrap();
            dump.write
        } else {
            writers
        };
        self.write(&mut writers, "\n".as_bytes(), logger);
        for mut writer in writers.into_iter() {
            if let Err(error) = writer.flush() {
                (logger.error_handler)(&anyhow::Error::from(error));
            }
            if let Err(error) = writer.logger.return_write(writer) {
                (logger.error_handler)(&error);
            }
        }
    }
pub fn log ( & self , record : & Record , logger : & NitroLogger ) { let mut writers = Vec :: new ( ) ; for target in self . targets . iter ( ) { if let Ok ( value ) = target . start_write ( record ) { writers . push ( value ) ; } } for values in & self . format . format { match values { FormatSection :: Text ( value ) => { self . write ( & mut writers , value . as_bytes ( ) , logger ) ; } FormatSection :: Variable ( variable ) => { self . write ( & mut writers , variable . get_value ( record . key_values ( ) ) . as_bytes ( ) , logger ) } FormatSection :: Placeholder ( placeholder ) => { self . write ( & mut writers , placeholder . build_message ( record ) . as_bytes ( ) , logger , ) ; } } } let mut writers = if self . structure_dump { let mut dump = DefaultStructureDump { write : writers } ; record . key_values ( ) . visit ( & mut dump ) . unwrap ( ) ; dump . write } else { writers } ; self . write ( & mut writers , " \n " . as_bytes ( ) , logger ) ; for mut writer in writers . into_iter ( ) { if let Err ( error ) = writer . flush ( ) { ( logger . error_handler ) ( & anyhow :: Error :: from ( error ) ) ; } if let Err ( error ) = writer . logger . return_write ( writer ) { ( logger . error_handler ) ( & error ) ; } } }
Logs a record
Handling Formatting and the internal writers
Logs a record Handling Formatting and the internal writers
&self
record
&Record
logger
&NitroLogger
&self
record
&Record
logger
&NitroLogger