code: def set_logger(name=None, filename=None, mode='a', level='NOTSET:NOTSET',
                 fmt=
                 '%(asctime)s %(filename)s:%(lineno)d [PID:%(process)-5d THD:%(thread)-5d %(levelname)-7s] %(message)s',
                 # fmt='[%(levelname)s] %(asctime)s %(message)s',
                 backup_count=5, limit=20480, when=None, with_filehandler=True):
      
      level = level.split(':')
   
      if len(level) == 1:  # Both set to the same level
          s_level = f_level = level[0]
      else:
          s_level = level[0]  # StreamHandler log level
          f_level = level[1]  # FileHandler log level
   
      init_logger(name=name)
      add_streamhandler(s_level, fmt)
      if with_filehandler:
          add_filehandler(f_level, fmt, filename, mode, backup_count, limit, when)
   
      # Import the common log functions for convenient
      import_log_funcs()
docs: Configure the global logger.