code: def _get_basic_logger(loggername, log_to_file, logpath):
      
      logger = logging.getLogger(loggername)
      logger.propagate = False
      remove_handlers(logger)
      logger.setLevel(logging.DEBUG)
      logger_config = LOGGING_CONFIG.get(loggername, DEFAULT_LOGGING_CONFIG)
      if TRUNCATE_LOG or logger_config.get("truncate_logs").get("truncate"):
          cfilter = ContextFilter()
          trunc_logs = logger_config.get("truncate_logs")
          # pylint: disable=invalid-name
          cfilter.MAXIMUM_LENGTH = trunc_logs.get("max_len",
                                                  DEFAULT_LOGGING_CONFIG.get(
                                                      "truncate_logs").get("max_len"))
          cfilter.REVEAL_LENGTH = trunc_logs.get("reveal_len",
                                                 DEFAULT_LOGGING_CONFIG.get(
                                                     "truncate_logs").get("reveal_len"))
          logger.addFilter(cfilter)
  
      # Filehandler for logger
      if log_to_file:
          _add_filehandler(logger, logpath, name=loggername)
  
      return logger
docs: Get a logger with our basic configuration done.
  
      :param loggername: Name of logger.
      :param log_to_file: Boolean, True if this logger should write a file.
      :return: Logger