summaryrefslogtreecommitdiffstats
path: root/CONTRIBUTING.md
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2022-08-01 18:07:06 +0200
committerGitHub <noreply@github.com>2022-08-01 18:07:06 +0200
commit68c5f1e051cee609fc75e575131ade78e5cbcb08 (patch)
tree55bc43dfb3761648b44f6c3f40d3e40c2c9b7224 /CONTRIBUTING.md
parent3bfc8e542108a045041b25320e84d555bedd36c4 (diff)
docs(contributing): document logging (#1627)
* docs(contributing): document logging * docs(contributing): add logging example
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r--CONTRIBUTING.md13
1 files changed, 13 insertions, 0 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 47437f160..0f62b09ef 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -83,6 +83,19 @@ Once you do, in the repository root:
To re-run the tests after you've changed something in the code base, be sure to repeat steps 2 and 3.
+## Debugging / Troubleshooting while developing
+Zellij uses the excellent [`log`](https://crates.io/crates/log) crate to handle its internal logging. The output of these logs will go to `/tmp/zellij-<UID>/zellij-log/zellij.log`.
+
+Example:
+```rust
+let my_variable = some_function();
+log::info!("my variable is: {:?}", my_variable);
+```
+
+Note that the output is truncated at 100KB. This can be adjusted for the purposes of debugging through the `LOG_MAX_BYTES` constant, at the time of writing here: https://github.com/zellij-org/zellij/blob/main/zellij-utils/src/logging.rs#L24
+
+When running Zellij with the `--debug` flag, Zellij will dump a copy of all bytes received over the pty for each pane in: `/tmp/zellij-<UID>/zellij-log/zellij-<pane_id>.log`. These might be useful when troubleshooting terminal issues.
+
## How we treat clippy lints
We currently use clippy in [GitHub Actions](https://github.com/zellij-org/zellij/blob/main/.github/workflows/rust.yml) with the default settings that report only [`clippy::correctness`](https://github.com/rust-lang/rust-clippy#readme) as errors and other lints as warnings because Zellij is still unstable. This means that all warnings can be ignored depending on the situation at that time, even though they are also helpful to keep the code quality.