Updated logging api to simplify the logging.