docs: def log(self, time, message, level=None, attachment=None):
          """Logs a message with attachment.
  
          The attachment is a dict of:
              name: name of attachment
              data: file content
              mime: content type for attachment
          """
          logger.debug("log queued")
  
          args = {
              "time": time,
              "message": message,
              "level": level,
              "attachment": attachment,
          }
          self.queue.put_nowait(("log", args))