code: def end_logging(filename=None):
      
  
      if logutil.global_logging_started:
          if filename:
              print('Trailer file written to: ', filename)
          else:
              # This generally shouldn't happen if logging was started with
              # init_logging and a filename was given...
              print('No trailer file saved...')
  
          logutil.teardown_global_logging()
      else:
          print('No trailer file saved...')
docs: Close log file and restore system defaults.