[snowpatch] [PATCH V2 3/3] docs: Add documentation for logging

Russell Currey ruscur at russell.cc
Wed Jun 15 14:42:07 AEST 2016


Pop our documentation cherry with a basic overview of logging.

Let's have a "docs" directory, and stick to GitHub Markdown since it's
fairly ubiquitous, and we can have something parse it and make it fancy
at some point.

Signed-off-by: Russell Currey <ruscur at russell.cc>
---
 docs/logging.md | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 docs/logging.md

diff --git a/docs/logging.md b/docs/logging.md
new file mode 100644
index 0000000..bcb5f09
--- /dev/null
+++ b/docs/logging.md
@@ -0,0 +1,21 @@
+== Logging ==
+
+snowpatch uses [env_logger](https://rust-lang-nursery.github.io/log/env_logger/index.html) to print information for the user.  By default, snowpatch will log everything at the "info" level, which is suitable for general use by non-snowpatch developers.  However, users may want to see less from snowpatch, and only have output when something has gone wrong.  On the other hand, users may want more information about why snowpatch is malfunctioning, or may desire more input while developing snowpatch itself.
+
+To specify the level of logging from snowpatch, set the RUST_LOG environment variable.  snowpatch uses the default env_logger environment variable, since it's easily searchable and it makes it obvious that the logging format is nothing specific to snowpatch.  Refer to the env_logger documentation for more details on that format; some examples are provided below.
+
+To log as much as possible, from snowpatch and libraries it uses:
+
+	`RUST_LOG=trace`
+
+As much as possible, but just from snowpatch itself:
+
+	`RUST_LOG=snowpatch=trace`
+
+Just the snowpatch defaults, and nothing from its libraries:
+
+	`RUST_LOG=snowpatch`
+
+Only print things that may require human attention:
+
+	`RUST_LOG=warn`
-- 
2.8.3



More information about the snowpatch mailing list