Skip to content

Commit

Permalink
doc: logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
2e0byo authored and harryfei committed Feb 24, 2023
1 parent 11d5bb9 commit c8ee95f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/handbook/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,20 @@ would also be cool if we would have a terminal emulator based on rust.

If you have any idea for a new feature you want to work on, just add a
configure option and create a new crate. Do not hesitate to ask for help.

## Logs and debugging

If you configure with `--enable-rust-debug` cargo will build a debug
build. We use [tracing](https://docs.rs/tracing/latest/tracing/) to
collect log output, and a handler (subscriber) is installed in
`main()` if cargo is building a debug build. (The subscriber is not
present in release builds, and hence logging is optimised out. Be
aware that emitting records can slow down emacs considerably.)

The default handler is configured with the `EMACSNG_LOG` environment
variable, in the format `target=level`. Crate *names* are targets, so
to log for the `webrender` crate (which is named `wrterm`) at the info
level, use `EMACSNG_LOG=wrterm=info`. Multiple filters can be
separated with a comma, and filters are capable of advanced filtering
with regexes. See the documentation for
[env_logger](https://docs.rs/env_logger/latest/env_logger/) for more details.

0 comments on commit c8ee95f

Please sign in to comment.