summaryrefslogtreecommitdiff
path: root/CONTRIBUTING.md
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2021-09-04 15:35:53 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2021-09-04 15:35:53 +0100
commit06444bbc95f59b9bd69d99cb9c666e6162b053b7 (patch)
treede6687b05d4c5013ba68730aba9206c82e7c8085 /CONTRIBUTING.md
parent385211d9104dd7bbd7431f33df90372ac6f3cd20 (diff)
downloadsubplot-06444bbc95f59b9bd69d99cb9c666e6162b053b7.tar.gz
tracing: Make formatting better and document
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r--CONTRIBUTING.md37
1 files changed, 29 insertions, 8 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 58a76f9..dc8ff9e 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -28,9 +28,9 @@ and branch we can pull from.
change the git repository, the full Subplot test suite must pass. To
run it, use the following command:
-~~~sh
+```sh
$ ./check -v
-~~~
+```
If you only touch documentation, and don't want to install all the
build dependencies, you can skip running the tests yourself.
@@ -67,7 +67,7 @@ changes unrelated to the rename.
**Keep commits in a merge request related:** If a commit adds a new
feature, it shouldn't also fix a bug in an old feature. If there's a
need to re-do the new feature, the bug fix will take longer to get
-merged.
+merged.
**Tell a story with a merge request:** The commits in a merge request
should be arranged in a way that make the change as a whole easy to
@@ -80,15 +80,36 @@ get there in the best possible way. You should tell the story of
flying by plane to get somewhere, not how you explored the world and
eventually invented flying machines to travel faster.
-
# Definition of done
When a change is made to Subplot, it must meet the following minimum
requirements to be considered "done": finished and not requiring
further work or attention.
-* if review of the change (in an MR or otherwise) has raised any
+- if review of the change (in an MR or otherwise) has raised any
issues, they have been resolved or filed as issues
-* the change has been merged to the main branch
-* ./check passes after the merge
-* all relevant issues have been updated appropriately or closed
+- the change has been merged to the main branch
+- ./check passes after the merge
+- all relevant issues have been updated appropriately or closed
+
+# Debugging subplot
+
+Ideally as a **user** of subplot you shouldn't need this, all error messages
+should give you sufficient context to chase down your problems. However if you
+are debugging a change to subplot itself then you may need to know how to do the
+following:
+
+1. You can change the logging level of subplot by means of the `SUBPLOT_LOG`
+ environment variable. If you set it to `trace` then it will show you absolutely
+ everything traced inside the program. You can learn about the syntax for
+ this variable on the [EnvFilter][] docs on `docs.rs`.
+2. You can redirect the logging to a file by means of the `SUBPLOT_LOG_FILE`
+ environment variable. Simply set it to the path you want to store logging to.
+ Subplot will _append_ to that file, so it's safe to have it in your environment
+ for multiple runs.
+3. To change the logging format, you can set `SUBPLOT_LOG_FORMAT` to one of:
+ `pretty` to have a multiline pretty format, `default` or `oneline` for a
+ basic one-line-per-event log format and `json` for a one-line-per-event JSON
+ log format.
+
+[envfilter]: https://docs.rs/tracing-subscriber/0.2.20/tracing_subscriber/filter/struct.EnvFilter.html