Skip to content

Commit ca78179

Browse files
liuchengxubkchrskunert
authored
Update prometheus binding failure logging format (#6979)
Using `{:#?}` for the error details is a bit annoying, this change makes a more consistent formatting style for error messages. --------- Co-authored-by: Bastian Köcher <[email protected]> Co-authored-by: command-bot <> Co-authored-by: Sebastian Kunert <[email protected]>
1 parent 88d900a commit ca78179

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

prdoc/pr_6979.prdoc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
title: Update prometheus binding failure logging format
2+
doc:
3+
- audience: Node Dev
4+
description: |-
5+
Using `{:#?}` for the error details is a bit annoying, this change makes a more consistent formatting style for error messages.
6+
crates:
7+
- name: substrate-prometheus-endpoint
8+
bump: patch

substrate/utils/prometheus/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ async fn request_metrics(
8787
/// to serve metrics.
8888
pub async fn init_prometheus(prometheus_addr: SocketAddr, registry: Registry) -> Result<(), Error> {
8989
let listener = tokio::net::TcpListener::bind(&prometheus_addr).await.map_err(|e| {
90-
log::error!(target: "prometheus", "Error binding to '{:#?}': {:#?}", prometheus_addr, e);
90+
log::error!(target: "prometheus", "Error binding to '{prometheus_addr:?}': {e:?}");
9191
Error::PortInUse(prometheus_addr)
9292
})?;
9393

0 commit comments

Comments
 (0)