Add logger and improve config system