Added support for error logging.