code: def init_log(logger, loglevel=0):
      
      # File for logging
      global log_tmp_dir, log_tmp_fn
      log_tmp_dir = tempfile.mkdtemp()
      log_tmp_fn = os.path.join(log_tmp_dir, 'multiqc.log')
  
      # Logging templates
      debug_template = '[%(asctime)s] %(name)-50s [%(levelname)-7s]  %(message)s'
      info_template = '[%(levelname)-7s] %(module)15s : %(message)s'
  
      # Base level setup
      logger.setLevel(getattr(logging, 'DEBUG'))
  
      # Set up the console logging stream
      console = logging.StreamHandler()
      console.setLevel(getattr(logging, loglevel))
      if loglevel == 'DEBUG':
          console.setFormatter(logging.Formatter(debug_template))
      else:
          console.setFormatter(logging.Formatter(info_template))
      logger.addHandler(console)
  
      # Now set up the file logging stream if we have a data directory
      file_handler = logging.FileHandler(log_tmp_fn, encoding='utf-8')
      file_handler.setLevel(getattr(logging, 'DEBUG')) # always DEBUG for the file
      file_handler.setFormatter(logging.Formatter(debug_template))
      logger.addHandler(file_handler)
docs: Initializes logging.
      Prints logs to console with level defined by loglevel
      Also prints verbose log to the multiqc data directory if available.
      (multiqc_data/multiqc.log)
  
      Args:
          loglevel (str): Determines the level of the log output.