-
Notifications
You must be signed in to change notification settings - Fork 1
makes tracing easier #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -66,6 +66,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { | |||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ## Feature Flag | ||||||
|
|
||||||
| **`tracing`**: Enables tracing for logging request/response traces. It requires a `RUST_LOG` environment variable to be set. | ||||||
|
||||||
| **`tracing`**: Enables tracing for logging request/response traces. It requires a `RUST_LOG` environment variable to be set. | |
| **`tracing`**: Enables tracing instrumentation for request/response traces. To see tracing output, your application must initialize a tracing subscriber (for example, with `tracing-subscriber`). A `RUST_LOG` environment variable is not required by this crate itself; it is optional and only has an effect if your subscriber is configured to read environment-based filters (for example, via `tracing-subscriber::EnvFilter`). |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -28,6 +28,10 @@ impl AgentServer { | |||||||||
| tarpc::serde_transport::tcp::listen(self.socket_addr, Json::default).await?; | ||||||||||
| listener.config_mut().max_frame_length(usize::MAX); | ||||||||||
|
|
||||||||||
| #[cfg(feature = "tracing")] | ||||||||||
| tracing::info!("Listening on: {}", listener.local_addr()); | ||||||||||
|
||||||||||
| tracing::info!("Listening on: {}", listener.local_addr()); | |
| tracing::info!("Listening on: {}", listener.local_addr()); | |
| #[cfg(not(feature = "tracing"))] | |
| println!("Listening on: {}", listener.local_addr()); |
Uh oh!
There was an error while loading. Please reload this page.