Implement log levels in and properly format output of LOG_ERRNO
- This enables us to use log levels for
LOG_ERRNO
. The default is the "warning" level so that we do not need to adjust all calls. The levels for connection establishment and receiving from sockets are adjusted to "info" such that common cases like unreachable peers do not unnecessarily clutter the logs. - This simplifies the logging of system error messages by passing everything to a single
fprintf
call. The error message is obtained fromstrerror
- as we guard everything via a semaphore this should not lead to any issue(s) we had in the past with it.
Fixes: #171 (closed), #172 (closed)