code: public void publish(String message, Level level) {
      try {
        publish(new LogRecord(level, message));
      }
      catch(BadLocationException e) {
        throw new RuntimeException("Error writing a log-like message.", e);
      }
    }
docs: Print a message as if it were logged, without going through the full
  logger.
  
  @param message
  Message text
  @param level
  Message level