Log thread_bus
IPC messages only in debug mode
#1800
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds a new static global variable
DEBUG_MODE
, accessible viazellij_utils::consts
. It is set when the server is spawned and depends on whether the server was started with the--debug
flag. This is automatically the case when the first client starting a session is started with the--debug
flag.The variable is stored globally to make it easily accessible from within error-handling functions without having to carry the option everywhere. Since it is set by the server upon creation, it is only set exactly once: When the session is started for the first time. Hence, clients connecting to a session with the
--debug
flag cannot override theDEBUG_MODE
value.Logging of the Instructions sent in the
zellij_server::thread_bus
will only happen when the server is running inDEBUG_MODE
. Otherwise, the error message is still shown as before, but the Instruction isn't included.This is done in an attempt to reduce flooding the terminal and logs for long instructions. Also increases the logsize to 16 MiB per file to keep it from filling up very quickly when a large instruction is dumped there.