iron / iron/logger

Logger does not reflect actual listening address and port

Open
#70 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
25
Forks
37
PR merge metrics
No merged PRs in 30d

Description

When asking Iron to listen on `localhost:0`, the kernel assigns an unused port number, and getaddrinfo resolves localhost to `127.0.0.1`. The actual address can be displayed via `format!("{}", listening.socket)` where `listening` is an instance of the type returned by `Iron::http` and friends.
### Example output from racerd

The first line is my own logging, and the second line is from this crate.

```
racerd listening at 127.0.0.1:54663
GET http://localhost:0/ping -> 200 OK (0.086167 ms)
```
### Discussion

I'm not familiar with all members of the `Request` type, but it seems that Iron would need to pass in either the address or a reference to the listening server in order to access this information.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.