aboutsummaryrefslogtreecommitdiff
path: root/azalea
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-12-11 20:52:49 -1100
committermat <git@matdoes.dev>2025-12-12 02:53:08 -0500
commit7c3a5768cda78cb9590aac1e1469d36333cd95ac (patch)
treeacecd4f57831e0fff47a8f96a1a30f6edb8825ed /azalea
parentf4a3c53eee7d29bade0c074f402c4a45aa98eca8 (diff)
downloadazalea-drasl-7c3a5768cda78cb9590aac1e1469d36333cd95ac.tar.xz
polish readmes
Diffstat (limited to 'azalea')
-rw-r--r--azalea/README.md12
1 files changed, 9 insertions, 3 deletions
diff --git a/azalea/README.md b/azalea/README.md
index 6b5c2601..e44036c3 100644
--- a/azalea/README.md
+++ b/azalea/README.md
@@ -1,7 +1,6 @@
Azalea is a framework for creating Minecraft bots.
-This page is primarily meant for developers that already know they want to use Azalea.
-See the [readme](https://github.com/azalea-rs/azalea) for a higher-level overview of Azalea.
+Also see the project [README](https://github.com/azalea-rs/azalea) for a higher-level overview of Azalea.
# Installation
@@ -116,10 +115,17 @@ If your code is simply hanging, it might be a deadlock. Enable `parking_lot`'s `
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.
-# Other common problems
+# Other notes
## Using `tokio::task::spawn_local` instead of `tokio::spawn`
If you spawn a task with `tokio::spawn` and move your bot into it, it's possible for Tokio to run the handler function or schedule a Minecraft tick at an unexpected moment. For instance, `bot.component::<TicksConnected>() == bot.component::<TicksConnected>()` is not guaranteed to be true inside of a `tokio::spawn`. Azalea already mitigates this in the handler function by using a Tokio [LocalSet](https://docs.rs/tokio/latest/tokio/task/struct.LocalSet.html), but that mitigation does not apply if you call `tokio::spawn` yourself. To avoid this, you must call `tokio::task::spawn_local` in place of `tokio::spawn`. Alternatively, you could also mark your main function with `#[tokio::main(flavor = "current_thread")]`.
+## Disabling log messages
+
+You can disable all console messages by setting the `RUST_LOG` environment variable to `off`, or you can filter log messages by setting specific log levels. For example, to disable only pathfinding logs, you can set `RUST_LOG=azalea::pathfinder=off`.
+
+See the [`env_logger`](https://docs.rs/env_logger/latest/env_logger/) crate documentation for more information.
+
[`bevy_log`]: https://docs.rs/bevy_log
+