humanlogio / humanlog

Logs for humans to read.
Apache License 2.0
744 stars 52 forks source link

make cross-platform `EADDRINUSE` check #85

Closed aybabtme closed 2 weeks ago

aybabtme commented 1 month ago

This function only works on unix, and not on windows. Make it cross platform.

https://github.com/humanlogio/humanlog/blob/4aff7533480c890cbfe174f40d4d9572788fdb66/cmd/humanlog/localhost.go#L35-L52

We want to know when we're trying to use an already used port, because that's how we find who's the localhost leader in a multi-process scenario (e.g. if multiple humanlog processes are running concurrently). The leader is whoever has the port.

aybabtme commented 2 weeks ago

solved by https://github.com/humanlogio/humanlog/pull/121