Skip to content

Commit b46411e

Browse files
committed
reduce logspam
1 parent 07ccaa8 commit b46411e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/server.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,17 @@ impl Server {
1616
pub async fn run(&self) -> Result<(), Box<dyn Error>> {
1717
let listen_addr = "127.0.0.1:".to_string() + &self.port.to_string();
1818

19-
log::info!("Listening on: {}", listen_addr);
19+
log::info!("cobalt started");
2020

21-
let listener = TcpListener::bind(listen_addr).await?;
21+
let listener = TcpListener::bind(&listen_addr).await?;
22+
23+
log::info!("listening on: {}", listen_addr);
2224

2325
// listener loop that passes off to handler
2426
while let Ok((inbound, _)) = listener.accept().await {
2527
let handler = handle(inbound, self.hosts.clone()).map(|r| {
2628
if let Err(e) = r {
27-
log::error!("Failed to handle request; error={}", e);
29+
log::error!("failed to handle request; {}", e);
2830
}
2931
});
3032

@@ -53,7 +55,7 @@ async fn handle(inbound: TcpStream, hosts: HashMap<String, String>) -> Result<()
5355
// proxy
5456
let proxy = proxy(inbound, to.to_string()).map(|r| {
5557
if let Err(e) = r {
56-
log::error!("Failed to proxy; error={}", e);
58+
log::error!("failed to proxy; {}", e);
5759
}
5860
});
5961

0 commit comments

Comments
 (0)