text: import copy
  import logging
  import colorama
  
  def colourize_string(string, colour):
      return '{color_begin}{string}{color_end}'.format(
          string=string,
          color_begin=colour,
          color_end=colorama.Style.RESET_ALL)
  
  def initialize_logger_format(logger):
      """
      Initialize the specified logger with a coloured format.
      """
  
      # specify colors for different logging levels
      LOG_COLORS = {
          logging.FATAL: colorama.Fore.LIGHTRED_EX,
          logging.ERROR: colorama.Fore.RED,
          logging.WARNING: colorama.Fore.YELLOW,
          logging.DEBUG: colorama.Fore.LIGHTWHITE_EX
      }
  
      LOG_LEVEL_FORMATS = {
          logging.INFO: '%(message)s'
      }
  
      class CustomFormatter(logging.Formatter):
          def format(self, record, *args, **kwargs):
              # if the corresponding logger has children, they may receive modified
              # record, so we want to keep it intact
              new_record = copy.copy(record)
              if new_record.levelno in LOG_COLORS:
                  # we want levelname to be in different color, so let's modify it
                  new_record.levelname = "{color_begin}{level}{color_end}".format(
                      level=new_record.levelname,
                      color_begin=LOG_COLORS[new_record.levelno],
                      color_end=colorama.Style.RESET_ALL,
                  )
  
              original_format = self._style._fmt
              self._style._fmt = LOG_LEVEL_FORMATS.get(record.levelno, original_format)
  
              # now we can let standart formatting take care of the rest
              result = super(CustomFormatter, self).format(new_record, *args, **kwargs)
  
              self._style._fmt = original_format
              return result
  
      handler = logging.StreamHandler()
      handler.setFormatter(CustomFormatter('%(levelname)s: %(message)s'))
      logger.addHandler(handler)
  
  def init_logger():
      logger = logging.getLogger(__name__)
      initialize_logger_format(logger)
  
      return logger