@Override
  public void log(Level logLevel, String message) {
    if (!messageConsumers.containsKey(logLevel)) {
      return;
    }
    Consumer<String> messageConsumer = messageConsumers.get(logLevel);

    // remove the color from the message
    final String plainMessage = message.replaceAll("\u001B\\[[0-9;]{1,5}m", "");
    singleThreadedExecutor.execute(() -> messageConsumer.accept(plainMessage));
  }
@Test
  public void testLog_ignoreIfNoMessageConsumer() {
    testPlainConsoleLogger =
        new PlainConsoleLogger(
            ImmutableMap.of(Level.WARN, createMessageConsumer(Level.WARN)), singleThreadedExecutor);

    testPlainConsoleLogger.log(Level.LIFECYCLE, "lifecycle");
    testPlainConsoleLogger.log(Level.PROGRESS, "progress");
    testPlainConsoleLogger.log(Level.INFO, "info");
    testPlainConsoleLogger.log(Level.DEBUG, "debug");
    testPlainConsoleLogger.log(Level.WARN, "warn");
    testPlainConsoleLogger.log(Level.ERROR, "error");

    singleThreadedExecutor.shutDownAndAwaitTermination(SHUTDOWN_TIMEOUT);

    Assert.assertEquals(Collections.singletonList(Level.WARN), levels);
    Assert.assertEquals(Collections.singletonList("warn"), messages);
  }