Added callback handling on log.error() calls. Added unit tests and documentation