Put IP address in brackets in log

This is necessary in particular to separate IPv6 addresses from the port number.  But it might as well be done for all address families, as it is common styles to put IP addresses in brackets in URLs, for example.

(I'm also open to an alternative version that only puts IPv6 in brackets, but this seemed simpler and also more future proof if you ever wanted to support resolved host names in the logs.)