Class LogUtils

java.lang.Object
com.github.chhorz.openapi.common.util.LogUtils

public class LogUtils extends Object
Internal logging utility class.
Author:
chhorz
  • Field Details

  • Constructor Details

    • LogUtils

      public LogUtils(Messager messager, ParserProperties properties)
      Creates a new LogUtils instance.
      Parameters:
      messager - the messager from the ProcessingEnvironment
      properties - the given parser properties that are required for the log level
    • LogUtils

      public LogUtils(Messager messager, ParserProperties properties, String componentLogGroup)
      Creates a new LogUtils instance.
      Parameters:
      messager - the messager from the ProcessingEnvironment
      properties - the given parser properties that are required for the log level
      componentLogGroup - a mandatory subgroup for the log statements
  • Method Details

    • configureWithComponent

      public LogUtils configureWithComponent(String componentLogGroup)
      Creates a cloned LogUtils class with the given component log group.
      Parameters:
      componentLogGroup - the subgroup for the log statements
      Returns:
      a new LogUtils class
    • logDebug

      public void logDebug(String format, Object... arguments)
      Prints the given log message if the log level is "DEBUG".

      The parameters are related to String.format(String, Object...).

      Parameters:
      format - the format string
      arguments - arguments for the format string
    • logInfo

      public void logInfo(String format, Object... arguments)
      Prints the given log message if the log level is not "ERROR".

      The parameters are related to String.format(String, Object...).

      Parameters:
      format - the format string
      arguments - arguments for the format string
    • logError

      public void logError(String format, Object... arguments)
      Prints the given log message.

      The parameters are related to String.format(String, Object...).

      Parameters:
      format - the format string
      arguments - arguments for the format string
    • logError

      public void logError(String format, Exception exception, Object... arguments)
      Prints the given log message.

      The parameters are related to String.format(String, Object...).

      Parameters:
      format - the format string
      exception - the current exception (will be logged via Throwable.printStackTrace())
      arguments - arguments for the format string