APISonar


javaemul.internal.ConsoleLogger.log

> javaemul > internal > ConsoleLogger > log
javaemul APIs internal APIs ConsoleLogger APIs log APIs

Example 1
public void log(String message, Throwable t) {
    ConsoleLogger console = ConsoleLogger.createIfSupported();
    if (console == null) {
      return;
    }
    console.log("log", message);
    if (t != null) {
      console.log("log", t);
    }
  }
Example 2
public void publish(LogRecord record) {
    ConsoleLogger console = ConsoleLogger.createIfSupported();
    if (console == null) {
      return;
    }
    if (!isLoggable(record)) {
      return;
    }

    String level = toConsoleLogLevel(record.getLevel());
    console.log(level, record.getMessage());
    if (record.getThrown() != null) {
      console.log(level, record.getThrown());
    }
  }