/// Log a record to the message bar.
Log a record to the message bar.
Log a record to the message bar .
fn message_bar_log(&self, record: &log::Record<'_>, logfile_path: &str) {
        let event_proxy = match self.event_proxy.lock() {
            Ok(event_proxy) => event_proxy,
            Err(_) => return,
        };
        #[cfg(not(windows))]
        let env_var = format!("${}", ALACRITTY_LOG_ENV);
        #[cfg(windows)]
        let env_var = format!("%{}%", ALACRITTY_LOG_ENV);
        let message = format!(
            "[{}] See log at {} ({}):\n{}",
            record.level(),
            logfile_path,
            env_var,
            record.args(),
        );
        let message_type = match record.level() {
            Level::Error => MessageType::Error,
            Level::Warn => MessageType::Warning,
            _ => unreachable!(),
        };
        let mut message = Message::new(message, message_type);
        message.set_target(record.target().to_owned());
        let _ = event_proxy.send_event(Event::Message(message));
    }
fn message_bar_log ( & self , record : & log :: Record < ' _ > , logfile_path : & str ) { let event_proxy = match self . event_proxy . lock ( ) { Ok ( event_proxy ) => event_proxy , Err ( _ ) => return , } ; # [ cfg ( not ( windows ) ) ] let env_var = format ! ( " " ALACRITTY_LOG_ENV ) ; # [ cfg ( windows ) ] let env_var = format ! ( " " ALACRITTY_LOG_ENV ) ; let message = format ! ( " \n " record level ( ) logfile_path env_var record args ( ) ) ; let message_type = match record . level ( ) { Level :: Error => MessageType :: Error , Level :: Warn => MessageType :: Warning , _ => unreachable ! ( ) , } ; let mut message = Message :: new ( message , message_type ) ; message . set_target ( record . target ( ) . to_owned ( ) ) ; let _ = event_proxy . send_event ( Event :: Message ( message ) ) ; }
Log a record to the message bar.
Log a record to the message bar .
&self
record
&log::Record<'_>
logfile_path
&str