diff mbox

[V2,3/3] docs: Add documentation for logging

Message ID 20160615044207.14547-4-ruscur@russell.cc
State Accepted
Headers show

Commit Message

Russell Currey June 15, 2016, 4:42 a.m. UTC
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@russell.cc>
---
 docs/logging.md | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 docs/logging.md

Comments

Andrew Donnellan June 15, 2016, 6:30 a.m. UTC | #1
On 15/06/16 14:42, Russell Currey wrote:
> 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@russell.cc>

Applied to master: e090f84864b6c4de03a19b3d5880a38f84bc1f97
diff mbox

Patch

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`