code: def log_to_python(cls, logger, msg):
          
          (level, timestamp, name, message) = tuple(msg.arguments)
          log_string = "%s %s: %s" % (timestamp, name, message)
          logger.log({"trace": 0,
                      "debug": logging.DEBUG,
                      "info": logging.INFO,
                      "warn": logging.WARN,
                      "error": logging.ERROR,
                      "fatal": logging.FATAL}[level], log_string)
docs: Log a KATCP logging message to a Python logger.
  
          Parameters
          ----------
          logger : logging.Logger object
              The Python logger to log the given message to.
          msg : Message object
              The #log message to create a log entry from.