pub fn start(mut self) -> Result<ReconfigurationHandle, FlexiLoggerError> {
        let max_level = self.spec.max_level();
        let spec = Arc::new(RwLock::new(self.spec));
        let other_writers = Arc::new(self.other_writers);

        let primary_writer = Arc::new(match self.log_target {
            LogTarget::File => {
                self.flwb = self.flwb.format(self.format_for_file);
                PrimaryWriter::multi(
                    self.duplicate,
                    self.format_for_stderr,
                    vec![Box::new(self.flwb.try_build()?)],
                )
            }
            LogTarget::Writer(w) => {
                self.flwb = self.flwb.format(self.format_for_file);
                PrimaryWriter::multi(self.duplicate, self.format_for_stderr, vec![w])
            }
            LogTarget::FileAndWriter(w) => {
                self.flwb = self.flwb.format(self.format_for_file);
                PrimaryWriter::multi(
                    self.duplicate,
                    self.format_for_stderr,
                    vec![Box::new(self.flwb.try_build()?), w],
                )
            }
            LogTarget::StdOut => PrimaryWriter::stdout(self.format_for_stderr),
            LogTarget::StdErr => PrimaryWriter::stderr(self.format_for_stderr),
            LogTarget::DevNull => PrimaryWriter::black_hole(self.duplicate, self.format_for_stderr),
        });

        let flexi_logger = FlexiLogger::new(
            Arc::clone(&spec),
            Arc::clone(&primary_writer),
            Arc::clone(&other_writers),
        );

        log::set_boxed_logger(Box::new(flexi_logger))?;
        let handle = ReconfigurationHandle::new(spec, primary_writer, other_writers);
        handle.reconfigure(max_level);
        Ok(handle)
    }
/// Consumes the Logger object and initializes `flexi_logger`.
///
/// The returned reconfiguration handle allows updating the log specification programmatically
/// later on, e.g. to intensify logging for (buggy) parts of a (test) program, etc.
/// See [ReconfigurationHandle](struct.ReconfigurationHandle.html) for an example.
Consumes the Logger object and initializes `flexi_logger`.
The returned reconfiguration handle allows updating the log specification programmatically
later on, e.g. to intensify logging for (buggy) parts of a (test) program, etc.
Consumes the Logger object and initializes ` flexi_logger ` . The returned reconfiguration handle allows updating the log specification programmatically later on e . g . to intensify logging for ( buggy ) parts of a ( test ) program etc .
pub fn start(mut self) -> Result<ReconfigurationHandle, FlexiLoggerError> {
        let max_level = self.spec.max_level();
        let spec = Arc::new(RwLock::new(self.spec));
        let other_writers = Arc::new(self.other_writers);
        let primary_writer = Arc::new(match self.log_target {
            LogTarget::File => {
                self.flwb = self.flwb.format(self.format_for_file);
                PrimaryWriter::multi(
                    self.duplicate,
                    self.format_for_stderr,
                    vec![Box::new(self.flwb.try_build()?)],
                )
            }
            LogTarget::Writer(w) => {
                self.flwb = self.flwb.format(self.format_for_file);
                PrimaryWriter::multi(self.duplicate, self.format_for_stderr, vec![w])
            }
            LogTarget::FileAndWriter(w) => {
                self.flwb = self.flwb.format(self.format_for_file);
                PrimaryWriter::multi(
                    self.duplicate,
                    self.format_for_stderr,
                    vec![Box::new(self.flwb.try_build()?), w],
                )
            }
            LogTarget::StdOut => PrimaryWriter::stdout(self.format_for_stderr),
            LogTarget::StdErr => PrimaryWriter::stderr(self.format_for_stderr),
            LogTarget::DevNull => PrimaryWriter::black_hole(self.duplicate, self.format_for_stderr),
        });
        let flexi_logger = FlexiLogger::new(
            Arc::clone(&spec),
            Arc::clone(&primary_writer),
            Arc::clone(&other_writers),
        );
        log::set_boxed_logger(Box::new(flexi_logger))?;
        let handle = ReconfigurationHandle::new(spec, primary_writer, other_writers);
        handle.reconfigure(max_level);
        Ok(handle)
    }
pub fn start ( mut self ) -> Result < ReconfigurationHandle , FlexiLoggerError > { let max_level = self . spec . max_level ( ) ; let spec = Arc :: new ( RwLock :: new ( self . spec ) ) ; let other_writers = Arc :: new ( self . other_writers ) ; let primary_writer = Arc :: new ( match self . log_target { LogTarget :: File => { self . flwb = self . flwb . format ( self . format_for_file ) ; PrimaryWriter :: multi ( self . duplicate , self . format_for_stderr , vec ! [ Box new ( self flwb try_build ( ) ) ] , ) } LogTarget :: Writer ( w ) => { self . flwb = self . flwb . format ( self . format_for_file ) ; PrimaryWriter :: multi ( self . duplicate , self . format_for_stderr , vec ! [ w ] ) } LogTarget :: FileAndWriter ( w ) => { self . flwb = self . flwb . format ( self . format_for_file ) ; PrimaryWriter :: multi ( self . duplicate , self . format_for_stderr , vec ! [ Box new ( self flwb try_build ( ) ) w ] , ) } LogTarget :: StdOut => PrimaryWriter :: stdout ( self . format_for_stderr ) , LogTarget :: StdErr => PrimaryWriter :: stderr ( self . format_for_stderr ) , LogTarget :: DevNull => PrimaryWriter :: black_hole ( self . duplicate , self . format_for_stderr ) , } ) ; let flexi_logger = FlexiLogger :: new ( Arc :: clone ( & spec ) , Arc :: clone ( & primary_writer ) , Arc :: clone ( & other_writers ) , ) ; log :: set_boxed_logger ( Box :: new ( flexi_logger ) ) ? ; let handle = ReconfigurationHandle :: new ( spec , primary_writer , other_writers ) ; handle . reconfigure ( max_level ) ; Ok ( handle ) }
Consumes the Logger object and initializes `flexi_logger`.
Consumes the Logger object and initializes ` flexi_logger ` .
mut self
mut self