Skip to content

Commit 1028f27

Browse files
committed
refactor(http1): use LOG constant only with tracing
1 parent 7cbc361 commit 1028f27

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/proto/h1/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ cfg_server! {
3030
pub(crate) trait Http1Transaction {
3131
type Incoming;
3232
type Outgoing: Default;
33+
#[cfg(feature = "tracing")]
3334
const LOG: &'static str;
3435
fn parse(bytes: &mut BytesMut, ctx: ParseContext<'_>) -> ParseResult<Self::Incoming>;
3536
fn encode(enc: Encode<'_, Self::Outgoing>, dst: &mut Vec<u8>) -> crate::Result<Encoder>;

src/proto/h1/role.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ pub(crate) enum Server {}
104104
impl Http1Transaction for Server {
105105
type Incoming = RequestLine;
106106
type Outgoing = StatusCode;
107+
#[cfg(feature = "tracing")]
107108
const LOG: &'static str = "{role=server}";
108109

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

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

0 commit comments

Comments
 (0)