Skip to content

Commit

Permalink
refactor(http1): use LOG constant only with tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar committed Jun 21, 2024
1 parent 7cbc361 commit 1028f27
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/proto/h1/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ cfg_server! {
pub(crate) trait Http1Transaction {
type Incoming;
type Outgoing: Default;
#[cfg(feature = "tracing")]
const LOG: &'static str;
fn parse(bytes: &mut BytesMut, ctx: ParseContext<'_>) -> ParseResult<Self::Incoming>;
fn encode(enc: Encode<'_, Self::Outgoing>, dst: &mut Vec<u8>) -> crate::Result<Encoder>;
Expand Down
2 changes: 2 additions & 0 deletions src/proto/h1/role.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ pub(crate) enum Server {}
impl Http1Transaction for Server {
type Incoming = RequestLine;
type Outgoing = StatusCode;
#[cfg(feature = "tracing")]
const LOG: &'static str = "{role=server}";

fn parse(buf: &mut BytesMut, ctx: ParseContext<'_>) -> ParseResult<RequestLine> {
Expand Down Expand Up @@ -964,6 +965,7 @@ trait HeaderNameWriter {
impl Http1Transaction for Client {
type Incoming = StatusCode;
type Outgoing = RequestLine;
#[cfg(feature = "tracing")]
const LOG: &'static str = "{role=client}";

fn parse(buf: &mut BytesMut, ctx: ParseContext<'_>) -> ParseResult<StatusCode> {
Expand Down

0 comments on commit 1028f27

Please sign in to comment.