aboutsummaryrefslogtreecommitdiff
path: root/azalea/README.md
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2023-02-25 17:32:15 -0600
committerGitHub <noreply@github.com>2023-02-25 17:32:15 -0600
commitc1588ef66e844c067112ea880a54b4de9ec5a062 (patch)
tree76e4f73a5f5392e1bef1f0560ed2f2c56b0d50fb /azalea/README.md
parentf5a8a59467a0aac3ae2f728961559217f1e1242d (diff)
downloadazalea-drasl-c1588ef66e844c067112ea880a54b4de9ec5a062.tar.xz
Fix system order ambiguities (#74)
* start fixing stuff where systems run in the wrong order * fix ordering ambiguity * add debugging guide * some fixes * fix panic for swarms * fix some warnings
Diffstat (limited to 'azalea/README.md')
-rwxr-xr-xazalea/README.md21
1 files changed, 21 insertions, 0 deletions
diff --git a/azalea/README.md b/azalea/README.md
index a9c44461..21be566a 100755
--- a/azalea/README.md
+++ b/azalea/README.md
@@ -83,4 +83,25 @@ Also note that just because something is an entity in the ECS doesn't mean that
See the [Bevy Cheatbook](https://bevy-cheatbook.github.io/programming/ecs-intro.html) to learn more about Bevy ECS (and the ECS paradigm in general).
+# Debugging
+
+Azalea uses several relatively complex features of Rust, which may make debugging certain issues more tricky if you're not familiar with them.
+
+## Logging
+
+One of the most useful tools for debugging issues is logging. The default log level is `info`, but you can make it show more or less information by changing the log level. Enabling logging is done with `RUST_LOG=debug cargo run` on Linux/bash or `set RUST_LOG=debug && cargo run` on Windows. The log levels are `trace`, `debug`, `info`, `warn`, and `error`, in ascending priority.
+
+If it's a crash/panic and you believe it has to do with parsing a packet, you might want to set the level to `trace` since that'll make it show the first few hundred bytes of every packet received. This may produce a lot of logs, so pipe it into a file with `&> azalea.log` (on Linux).
+
+Note: If you get a `SetLoggerError`, it's because you have multiple loggers. Azalea comes with a logger by default, see [`bevy_log`] for more information.
+
+## Deadlocks
+
+If your code is simply hanging, it might be a deadlock. Copy the deadlock block in [`azalea/examples/testbot.rs`](https://github.com/mat-1/azalea/blob/main/azalea/examples/testbot.rs) to the beginning of your code and it'll print a long backtrace if a deadlock is detected.
+
+## Backtraces
+
+Backtraces are also useful, though they're sometimes hard to read and don't always contain the actual location of the error. Run your code with `RUST_BACKTRACE=1` to enable full backtraces. If it's very long, often searching for the keyword "azalea" will help you filter out unrelated things and find the actual source of the issue.
+
[`azalea_client`]: https://docs.rs/azalea-client
+[`bevy_log`]: https://docs.rs/bevy_log