Skip to content

Commit 22c4ac5

Browse files
committed
remove P::name() calls from log statements
1 parent a0aafca commit 22c4ac5

File tree

3 files changed

+10
-69
lines changed

3 files changed

+10
-69
lines changed

crates/rproxy/src/server/proxy.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,19 @@ where
5454
let remote_addr = match stream.peer_addr() {
5555
Ok(local_addr) => Some(local_addr.to_string()),
5656
Err(err) => {
57-
warn!(proxy = P::name(), error = ?err, "Failed to get remote address");
57+
warn!(error = ?err, "Failed to get remote address");
5858
None
5959
}
6060
};
6161
let local_addr = match stream.local_addr() {
6262
Ok(local_addr) => Some(local_addr.to_string()),
6363
Err(err) => {
64-
warn!(proxy = P::name(), error = ?err, "Failed to get remote address");
64+
warn!(error = ?err, "Failed to get remote address");
6565
None
6666
}
6767
};
6868

6969
debug!(
70-
proxy = P::name(),
7170
connection_id = %id,
7271
remote_addr = remote_addr.as_ref().map_or("unknown", |v| v.as_str()),
7372
local_addr = local_addr.as_ref().map_or("unknown", |v| v.as_str()),

crates/rproxy/src/server/proxy/http/proxy.rs

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ where
9090
fn new(shared: ProxyHttpSharedState<C, P>, connections_limit: usize) -> Self {
9191
let id = Uuid::now_v7();
9292

93-
debug!(proxy = P::name(), worker_id = %id, "Creating http-proxy worker...");
93+
debug!(worker_id = %id, "Creating http-proxy worker...");
9494

9595
let config = shared.config();
9696
let inner = shared.inner();
@@ -147,7 +147,6 @@ where
147147
Ok(listener) => listener,
148148
Err(err) => {
149149
error!(
150-
proxy = P::name(),
151150
addr = %config.listen_address(),
152151
error = ?err,
153152
"Failed to initialise a socket"
@@ -175,7 +174,6 @@ where
175174
let client_connections_count = shared.client_connections_count.clone();
176175

177176
info!(
178-
proxy = P::name(),
179177
listen_address = %listen_address,
180178
workers_count = workers_count,
181179
max_concurrent_requests_per_worker = max_concurrent_requests_per_worker,
@@ -212,7 +210,6 @@ where
212210
Ok(server) => server,
213211
Err(err) => {
214212
error!(
215-
proxy = P::name(),
216213
error = ?err,
217214
"Failed to initialise http-proxy",
218215
);
@@ -225,16 +222,16 @@ where
225222
let mut resetter = resetter.subscribe();
226223
tokio::spawn(async move {
227224
if resetter.recv().await.is_ok() {
228-
info!(proxy = P::name(), "Reset signal received, stopping http-proxy...");
225+
info!("Reset signal received, stopping http-proxy...");
229226
handler.stop(true).await;
230227
}
231228
});
232229

233230
if let Err(err) = server.await {
234-
error!(proxy = P::name(), error = ?err, "Failure while running http-proxy")
231+
error!(error = ?err, "Failure while running http-proxy")
235232
}
236233

237-
info!(proxy = P::name(), "Stopped http-proxy");
234+
info!("Stopped http-proxy");
238235

239236
Ok(())
240237
}
@@ -325,7 +322,6 @@ where
325322
Ok(res) => res,
326323
Err(err) => {
327324
warn!(
328-
proxy = P::name(),
329325
request_id = %id,
330326
connection_id = %connection_id,
331327
worker_id = %this.id,
@@ -364,7 +360,6 @@ where
364360

365361
if self.requests.insert_sync(id, req).is_err() {
366362
error!(
367-
proxy = P::name(),
368363
request_id = %id,
369364
connection_id = %connection_id,
370365
worker_id = %self.id,
@@ -378,7 +373,6 @@ where
378373
Some((_, req)) => req,
379374
None => {
380375
error!(
381-
proxy = P::name(),
382376
request_id = %bck_res.info.id,
383377
worker_id = %self.id,
384378
"Proxied http response for unmatching request",
@@ -446,7 +440,6 @@ where
446440

447441
Err(err) => {
448442
warn!(
449-
proxy = P::name(),
450443
request_id = %cli_req.info.id,
451444
connection_id = %cli_req.info.connection_id,
452445
worker_id = %worker_id,
@@ -513,7 +506,6 @@ where
513506
};
514507

515508
info!(
516-
proxy = P::name(),
517509
request_id = %req.info.id,
518510
connection_id = %req.info.connection_id,
519511
worker_id = %worker_id,
@@ -554,7 +546,6 @@ where
554546
};
555547

556548
info!(
557-
proxy = P::name(),
558549
request_id = %req.info.id,
559550
connection_id = %req.info.connection_id,
560551
worker_id = %worker_id,
@@ -806,7 +797,6 @@ where
806797
{
807798
fn drop(&mut self) {
808799
debug!(
809-
proxy = P::name(),
810800
worker_id = %self.id,
811801
"Destroying http-proxy worker...",
812802
);
@@ -1045,7 +1035,6 @@ where
10451035
}
10461036
Err(err) => {
10471037
warn!(
1048-
proxy = P::name(),
10491038
request_id = %cli_req.info.id,
10501039
connection_id = %cli_req.info.connection_id,
10511040
error = ?err,
@@ -1061,7 +1050,6 @@ where
10611050

10621051
Err(err) => {
10631052
warn!(
1064-
proxy = P::name(),
10651053
request_id = %cli_req.info.id,
10661054
connection_id = %cli_req.info.connection_id,
10671055
error = ?err,
@@ -1287,15 +1275,13 @@ where
12871275
Poll::Ready(Some(Err(err))) => {
12881276
if let Some(info) = mem::take(this.info) {
12891277
warn!(
1290-
proxy = P::name(),
12911278
request_id = %info.id(),
12921279
connection_id = %info.connection_id(),
12931280
error = ?err,
12941281
"Proxy http request stream error",
12951282
);
12961283
} else {
12971284
warn!(
1298-
proxy = P::name(),
12991285
error = ?err,
13001286
request_id = "unknown",
13011287
"Proxy http request stream error",
@@ -1385,14 +1371,12 @@ where
13851371
Poll::Ready(Some(Err(err))) => {
13861372
if let Some(info) = mem::take(this.info) {
13871373
warn!(
1388-
proxy = P::name(),
13891374
request_id = %info.id(),
13901375
error = ?err,
13911376
"Proxy http response stream error",
13921377
);
13931378
} else {
13941379
warn!(
1395-
proxy = P::name(),
13961380
error = ?err,
13971381
request_id = "unknown",
13981382
"Proxy http response stream error",

0 commit comments

Comments
 (0)