code: def config_logger(name='andes',
                    log_file='andes.log',
                    log_path='',
                    stream=True,
                    stream_level=logging.INFO
                    ):
      
      logger = logging.getLogger(name)
      logger.setLevel(logging.DEBUG)
  
      # file handler for level DEBUG and up
      if log_file is not None:
          log_full_path = os.path.join(log_path, log_file)
          fh_formatter = logging.Formatter(
              '%(asctime)s - %(name)s - %(levelname)s - %(message)s')
          fh = logging.FileHandler(log_full_path)
          fh.setLevel(logging.DEBUG)
          fh.setFormatter(fh_formatter)
          logger.addHandler(fh)
          logger.debug('Writing log to {}'.format(log_full_path))
  
      if stream is True:
          sh_formatter = logging.Formatter('%(message)s')
          sh = logging.StreamHandler()
  
          sh.setFormatter(sh_formatter)
          sh.setLevel(stream_level)
          logger.addHandler(sh)
  
      globals()['logger'] = logger
docs: Configure a logger for the andes package with options for a `FileHandler`
      and a `StreamHandler`. This function is called at the beginning of
      ``andes.main.main()``.
  
      Parameters
      ----------
      name : str, optional
          Base logger name, ``'andes'`` by default. Changing this
          parameter will affect the loggers in modules and
          cause unexpected behaviours.
      log_file : str, optional
          Logg file name for `FileHandler`, ``'andes.log'`` by default.
          If ``None``, the `FileHandler` will not be created.
      log_path : str, optional
          Path to store the log file. By default, the path is generated by
          get_log_dir() in utils.misc.
      stream : bool, optional
          Create a `StreamHandler` for `stdout` if ``True``.
          If ``False``, the handler will not be created.
      stream_level : {10, 20, 30, 40, 50}, optional
          `StreamHandler` verbosity level.
  
      Returns
      -------
      None