code: def init_logging(settings):
      '''Set up logger'''
      lg_format = '%(asctime)s : - %(message)s'
      lg_dateformat = '%Y.%m.%d %H:%M:%S'
      logging.basicConfig(format=lg_format, datefmt=lg_dateformat)
  
      log = get_logger()
  
      handler = logging.handlers.WatchedFileHandler(
                              filename=settings['log_file'] \
                              if 'log_file' in settings.keys() else None,
                              encoding='utf-8')
      formatter = logging.Formatter(fmt=lg_format, datefmt=lg_dateformat)
      handler.setFormatter(formatter)
      log.addHandler(handler)
      return lof init_logging(settings):
      '''Set up logger'''
      lg_format = '%(asctime)s : - %(message)s'
      lg_dateformat = '%Y.%m.%d %H:%M:%S'
      logging.basicConfig(format=lg_format, datefmt=lg_dateformat)
  
      log = get_logger()
  
      handler = logging.handlers.WatchedFileHandler(
                              filename=settings['log_file'] \
                              if 'log_file' in settings.keys() else None,
                              encoding='utf-8')
      formatter = logging.Formatter(fmt=lg_format, datefmt=lg_dateformat)
      handler.setFormatter(formatter)
      log.addHandler(handler)
      return log
docs: Set up logger