fixes the bug that logger and log_level can not be set
adds fails when argument is not given
adds debug log