Class ConsoleLogger

All Implemented Interfaces:
JsonLogger, Logger
Direct Known Subclasses:
LoggerMock, StringLogger

public class ConsoleLogger extends AbstractLogger
Implementation of a console logger, filters some key/value combinations to better display the messages.
  • Constructor Details

    • ConsoleLogger

      public ConsoleLogger()
      Specifies its own class name as the logging class. prefer ConsoleLogger(Class)
    • ConsoleLogger

      public ConsoleLogger(Class aClass)
      Parameters:
      aClass - the class that uses this logger.
    • ConsoleLogger

      public ConsoleLogger(CoreContext context, Class aClass)
      Parameters:
      context - the context the logger is used on.
      aClass - the class that uses this logger.
  • Method Details

    • close

      public void close() throws SecurityException
      Description copied from interface: Logger
      Shuts down the logger instance, frees any resources such as files or thread pools.
      Specified by:
      close in interface Logger
      Overrides:
      close in class AbstractLogger
      Throws:
      SecurityException
    • setEnabled

      public Logger setEnabled(boolean enabled)
      Parameters:
      enabled - disable/enable output of the logger.
      Returns:
      fluent
    • getFilteredKeys

      public Set<String> getFilteredKeys()
      Returns:
      a set of keys that will not be printed to the console.
    • log

      public Logger log(io.vertx.core.json.JsonObject data)
      Specified by:
      log in interface JsonLogger
      Overrides:
      log in class AbstractLogger
      Parameters:
      data - the data to be logged.
      Returns:
      fluent
    • parseJsonLog

      protected String parseJsonLog(io.vertx.core.json.JsonObject data, String event)
    • consumeLevel

      protected LogLevel consumeLevel(io.vertx.core.json.JsonObject data)
    • log

      Logger log(String line)
      Parameters:
      line - the text line to be logged.
      Returns:
      fluent
    • log

      Logger log(String line, LogLevel level)
      Parameters:
      line - the text line to be logged.
      level - the logging level to log with.
      Returns:
      fluent