Skip to content

Commit

Permalink
Point out potential pitfall in documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Sep 17, 2021
1 parent e530e6c commit 8f4f598
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tower-http/src/trace/on_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,15 @@ impl DefaultOnRequest {

/// Set the [`Level`] used for [tracing events].
///
/// Please note that while this will set the level for the tracing events
/// themselves, it might cause them to lack expected information, like
/// request method or path. You can address this using
/// [`DefaultMakeSpan::level`].
///
/// Defaults to [`Level::DEBUG`].
///
/// [tracing events]: https://docs.rs/tracing/latest/tracing/#events
/// [`DefaultMakeSpan::level`]: crate::trace::DefaultMakeSpan::level
pub fn level(mut self, level: Level) -> Self {
self.level = level;
self
Expand Down
6 changes: 6 additions & 0 deletions tower-http/src/trace/on_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,15 @@ impl DefaultOnResponse {

/// Set the [`Level`] used for [tracing events].
///
/// Please note that while this will set the level for the tracing events
/// themselves, it might cause them to lack expected information, like
/// request method or path. You can address this using
/// [`DefaultMakeSpan::level`].
///
/// Defaults to [`Level::DEBUG`].
///
/// [tracing events]: https://docs.rs/tracing/latest/tracing/#events
/// [`DefaultMakeSpan::level`]: crate::trace::DefaultMakeSpan::level
pub fn level(mut self, level: Level) -> Self {
self.level = level;
self
Expand Down

0 comments on commit 8f4f598

Please sign in to comment.