Skip to content

Commit

Permalink
Add logging docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mooreryan committed Jan 14, 2021
1 parent f6cb713 commit c48af0d
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions docs/logging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Logging

`divnet-rs` logs various things to standard error during a run.

## Log levels

There are multiple log levels. Here they are from least important to most important.

- `trace`
- `debug`
- `info`
- `warn`
- `error`

By default `divnet-rs` only prints `info`, `warn`, and `error` messages.

If you want, you can turn on the lower level messages using the `RUST_LOG` [environmental variable](https://www.digitalocean.com/community/tutorials/how-to-read-and-set-environmental-and-shell-variables-on-linux) like this:

```
RUST_LOG=debug divnet-rs config.toml
```

That would tell `divnet-rs` to print all `debug` messages plus any messages that are of higher importance (`info`, `warn`, and `error`).

If you want fewer messages, you could use `RUST_LOG=warn` or `RUST_LOG=error`.

## Recommendation

Generally the default log level is fine. It's also nice since you don't have to set any environmental variables!

If you have very large input files and want to see the most logging, for example to try and estimate the time remaining, you could turn on mode messages with `RUST_LOG=trace` or `RUST_LOG=trace`. It will put a lot of output though.

0 comments on commit c48af0d

Please sign in to comment.