aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/logging.rs
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2022-09-17 13:32:10 +0000
committerGitHub <noreply@github.com>2022-09-17 13:32:10 +0000
commitc5ae05e810a5866a9133b2e88edba3a42706319f (patch)
treeeff78be6f3888eb550b56dac5bc45774d55aa259 /alacritty/src/logging.rs
parent3a38f0b996bc0e340646008bcfd8ad7192774eeb (diff)
downloadr-alacritty-c5ae05e810a5866a9133b2e88edba3a42706319f.tar.gz
r-alacritty-c5ae05e810a5866a9133b2e88edba3a42706319f.tar.bz2
r-alacritty-c5ae05e810a5866a9133b2e88edba3a42706319f.zip
Fix IPC config overriding previous values
Before this patch whenever changing the IPC configuration, all previous configuration options would be discarded. This was the case even when the new option was invalid. This patch ensures that the IPC config is only ever cleared when the `--reset` flag is passed. Invalid IPC config options are logged and discarded. Additionally whenever a new IPC config message is sent, all previous IPC error messages are cleared. Closes #6330.
Diffstat (limited to 'alacritty/src/logging.rs')
-rw-r--r--alacritty/src/logging.rs16
1 files changed, 14 insertions, 2 deletions
diff --git a/alacritty/src/logging.rs b/alacritty/src/logging.rs
index f3405e58..113e96ff 100644
--- a/alacritty/src/logging.rs
+++ b/alacritty/src/logging.rs
@@ -15,15 +15,27 @@ use std::{env, process};
use glutin::event_loop::EventLoopProxy;
use log::{self, Level, LevelFilter};
+use alacritty_terminal::config::LOG_TARGET_CONFIG;
+
use crate::cli::Options;
use crate::event::{Event, EventType};
use crate::message_bar::{Message, MessageType};
+/// Logging target for IPC config error messages.
+pub const LOG_TARGET_IPC_CONFIG: &str = "alacritty_log_ipc_config";
+
/// Name for the environment variable containing the log file's path.
const ALACRITTY_LOG_ENV: &str = "ALACRITTY_LOG";
+
/// List of targets which will be logged by Alacritty.
-const ALLOWED_TARGETS: [&str; 4] =
- ["alacritty_terminal", "alacritty_config_derive", "alacritty", "crossfont"];
+const ALLOWED_TARGETS: &[&str] = &[
+ LOG_TARGET_IPC_CONFIG,
+ LOG_TARGET_CONFIG,
+ "alacritty_config_derive",
+ "alacritty_terminal",
+ "alacritty",
+ "crossfont",
+];
pub fn initialize(
options: &Options,