summaryrefslogtreecommitdiffstats
path: root/zellij-utils/src/consts.rs
diff options
context:
space:
mode:
authorhar7an <99636919+har7an@users.noreply.github.com>2022-10-17 15:34:06 +0000
committerGitHub <noreply@github.com>2022-10-17 15:34:06 +0000
commitf26e73ce03241cab89ee75aa1853973c21b22fc1 (patch)
treecc1535da82bfbfa44bee577ea4c58887f9dc4f70 /zellij-utils/src/consts.rs
parent2ae057d061db2dc4d41afe39cb40197d3d01c616 (diff)
Log `thread_bus` IPC messages only in debug mode (#1800)
* zellij: Add global `DEBUG_MODE` variable that tells us whether zellij was started with the `--debug` CLI flag. * utils/errors: Only log thread_bus message in debug mode, and discard the message otherwise. * utils/logging: Increase logsize to 16 MiB per logfile, totaling 32 MiB of logs at most (in two files). * zellij: Set global `DEBUG` variable in server thread and make sure the value of the `--debug` CLI flag is propagated to the server, too. This means that to enable debug mode, the server must be started with the `--debug` flag. This happens when the first client that starts the zellij session has the `--debug` flag set, because it will be forwarded to the server. Subsequent clients attaching to the same session with the `--debug` flag specified **do not** override the value of the `DEBUG` variable. Hence, if the server wasn't started in debug mode, this cannot be changed.
Diffstat (limited to 'zellij-utils/src/consts.rs')
-rw-r--r--zellij-utils/src/consts.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/zellij-utils/src/consts.rs b/zellij-utils/src/consts.rs
index cb11315fc..52e2f2369 100644
--- a/zellij-utils/src/consts.rs
+++ b/zellij-utils/src/consts.rs
@@ -11,6 +11,7 @@ pub const ZELLIJ_LAYOUT_DIR_ENV: &str = "ZELLIJ_LAYOUT_DIR";
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
pub const DEFAULT_SCROLL_BUFFER_SIZE: usize = 10_000;
pub static SCROLL_BUFFER_SIZE: OnceCell<usize> = OnceCell::new();
+pub static DEBUG_MODE: OnceCell<bool> = OnceCell::new();
pub const SYSTEM_DEFAULT_CONFIG_DIR: &str = "/etc/zellij";
pub const SYSTEM_DEFAULT_DATA_DIR_PREFIX: &str = system_default_data_dir();