Tests and implementation of logging.