Added logging and log-level parsing