Improving logging performance

- Guard string concatenation by log level tests
- Send exceptions to the logger in place of syserr