aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/logging.rs
diff options
context:
space:
mode:
authorKirill Chibisov <contact@kchibisov.com>2020-08-13 14:59:35 +0300
committerGitHub <noreply@github.com>2020-08-13 14:59:35 +0300
commit0a1683e84dfa1d89e65e9b43ed5d586ece47c8dd (patch)
tree2ce83fa033a32f7ed74fc666d300f8d7ec36e748 /alacritty/src/logging.rs
parentf2211080867f6053b11194819e6e1a9c48cc21ec (diff)
downloadr-alacritty-0a1683e84dfa1d89e65e9b43ed5d586ece47c8dd.tar.gz
r-alacritty-0a1683e84dfa1d89e65e9b43ed5d586ece47c8dd.tar.bz2
r-alacritty-0a1683e84dfa1d89e65e9b43ed5d586ece47c8dd.zip
Use yellow/red from the config for message bar colors
This commit completes the effort to use config colors for message bar content by picking red/yellow from user's colors.normal.{red,yellow} for error/warning messages instead of fixed colors. It also removes alacritty_terminal::term::color::RED and alacritty_terminal::term::color::YELLOW from the alacritty_terminal API, bumping its version to 0.11.0-dev. Fixes #4116.
Diffstat (limited to 'alacritty/src/logging.rs')
-rw-r--r--alacritty/src/logging.rs12
1 files changed, 5 insertions, 7 deletions
diff --git a/alacritty/src/logging.rs b/alacritty/src/logging.rs
index 5d702999..5dddad3e 100644
--- a/alacritty/src/logging.rs
+++ b/alacritty/src/logging.rs
@@ -15,11 +15,9 @@ use std::sync::{Arc, Mutex};
use glutin::event_loop::EventLoopProxy;
use log::{self, Level};
-use alacritty_terminal::term::color;
-
use crate::cli::Options;
use crate::event::Event;
-use crate::message_bar::Message;
+use crate::message_bar::{Message, MessageType};
const ALACRITTY_LOG_ENV: &str = "ALACRITTY_LOG";
@@ -97,14 +95,14 @@ impl log::Log for Logger {
env_var,
record.args(),
);
- let color = match record.level() {
- Level::Error => color::RED,
- Level::Warn => color::YELLOW,
+ let message_type = match record.level() {
+ Level::Error => MessageType::Error,
+ Level::Warn => MessageType::Warning,
_ => unreachable!(),
};
if let Ok(event_proxy) = self.event_proxy.lock() {
- let mut message = Message::new(msg, color);
+ let mut message = Message::new(msg, message_type);
message.set_target(record.target().to_owned());
let _ = event_proxy.send_event(Event::Message(message));