Remove not None check and refactor log_file init