code: def test_logging_options(tmp_path):
      """Test logging (to file)."""
      with use_log_level(None):  # just ensure it's set back
          with pytest.raises(
              ValueError, match="Invalid value for the 'verbose"
          ):
              set_log_level("foo")
          test_name = tmp_path / "test.log"
          with open(fname_log) as old_log_file:
              # [:-1] used to strip an extra "No baseline correction applied"
              old_lines = clean_lines(old_log_file.readlines())
              old_lines.pop(-1)
          with open(fname_log_2) as old_log_file_2:
              old_lines_2 = clean_lines(old_log_file_2.readlines())
              old_lines_2.pop(14)
              old_lines_2.pop(-1)
  
          if test_name.is_file():
              os.remove(test_name)
          # test it one way (printing default off)
          set_log_file(test_name)
          set_log_level("WARNING")
          # should NOT print
          evoked = read_evokeds(fname_evoked, condition=1)
          with open(test_name) as fid:
              assert fid.readlines() == []
          # should NOT print
          evoked = read_evokeds(
              fname_evoked, condition=1, verbose=False
          )
          with open(test_name) as fid:
              assert fid.readlines() == []
          # should NOT print
          evoked = read_evokeds(
              fname_evoked, condition=1, verbose="WARNING"
          )
          with open(test_name) as fid:
              assert fid.readlines() == []
          # SHOULD print
          evoked = read_evokeds(fname_evoked, condition=1, verbose=True)
          with open(test_name) as new_log_file:
              new_lines = clean_lines(new_log_file.readlines())
          assert new_lines == old_lines
          set_log_file(None)  # Need to do this to close the old file
          os.remove(test_name)
  
          # now go the other way (printing default on)
          set_log_file(test_name)
          set_log_level("INFO")
          # should NOT print
          evoked = read_evokeds(
              fname_evoked, condition=1, verbose="WARNING"
          )
          with open(test_name) as fid:
              assert fid.readlines() == []
          # should NOT print
          evoked = read_evokeds(
              fname_evoked, condition=1, verbose=False
          )
          with open(test_name) as fid:
              assert fid.readlines() == []
          # SHOULD print
          evoked = read_evokeds(fname_evoked, condition=1)
          with open(test_name) as new_log_file:
              new_lines = clean_lines(new_log_file.readlines())
          assert new_lines == old_lines
          # check to make sure appending works (and as default, raises a warning)
          set_log_file(test_name, overwrite=False)
          with pytest.warns(
              RuntimeWarning, match="appended to the file"
          ):
              set_log_file(test_name)
          evoked = read_evokeds(fname_evoked, condition=1)
          with open(test_name) as new_log_file:
              new_lines = clean_lines(new_log_file.readlines())
          assert new_lines == old_lines_2
  
          # make sure overwriting works
          set_log_file(test_name, overwrite=True)
          # this line needs to be called to actually do some logging
          evoked = read_evokeds(fname_evoked, condition=1)
          del evoked
          with open(test_name) as new_log_file:
              new_lines = clean_lines(new_log_file.readlines())
          assert new_lines == old_lines
      with catch_logging() as log:
          pass
      assert log.getvalue() == ""
  
imports: import logging
  import os
  import re
  import warnings
  from pathlib import Path
  import numpy
  import pytest
  from mne import Epochs, create_info, read_evokeds
  from mne.io import RawArray, read_raw_fif
  from mne.parallel import parallel_func
  from mne.utils import _get_call_line, catch_logging, check, filter_out_warnings, logger, set_log_file, set_log_level, use_log_level, verbose, warn
  from mne.utils._logging import _frame_info
label_desc: Use image node_id 5 for calling a global function with example usage: test_logging_options(tmp_path) without return types