Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Changes
Add a host metadata decorator. Supports adding hostname and ip address to the log entries.
Currently there is no customization for what IP address, but in the future, we may add options for preferred interface, ipv4 vs ipv6, or an option to add external IP.
I was unable to figure out a way to mock calls to
net.Interfaces()
effectively, so our tests currently don't test the IP functionality at all. Would love to hear ideas, but I'm currently convinced it's not possible. See this for more detail: https://stackoverflow.com/questions/24564840/golang-net-package-mockingPlease check that the PR fulfills these requirements