Modified code and applied rubocop on logger_ex file.