Class WrappedLogger

All Implemented Interfaces:
Serializable, Logger, ExtendedLogger, LocationAwareLogger

class WrappedLogger extends ExtendedLoggerWrapper
Wrapper class to ensure proper FQCN support in Logger calls.
Since:
2.1
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • FQCN

      private static final String FQCN
  • Constructor Details

  • Method Details

    • log

      public void log(Level level, String message, Throwable t)
      Description copied from interface: Logger
      Logs a message at the given level including the stack trace of the Throwable throwable passed as parameter.
      Specified by:
      log in interface Logger
      Overrides:
      log in class AbstractLogger
      Parameters:
      level - the logging level
      message - the message to log.
      t - the Throwable to log, including its stack trace.
    • log

      public void log(Level level, String message, Object... params)
      Description copied from interface: Logger
      Logs a message with parameters at the given level.
      Specified by:
      log in interface Logger
      Overrides:
      log in class AbstractLogger
      Parameters:
      level - the logging level
      message - the message to log; the format depends on the message factory.
      params - parameters to the message.
      See Also:
    • log

      public void log(Level level, String message)
      Description copied from interface: Logger
      Logs a message object with the given level.
      Specified by:
      log in interface Logger
      Overrides:
      log in class AbstractLogger
      Parameters:
      level - the logging level
      message - the message string to log.
    • entry

      public void entry()
      Description copied from interface: Logger
      Logs entry to a method. Used when the method in question has no parameters or when the parameters should not be logged.
      Specified by:
      entry in interface Logger
      Overrides:
      entry in class AbstractLogger
    • entry

      public void entry(Object... params)
      Description copied from interface: Logger
      Logs entry to a method along with its parameters (consider using one of the traceEntry(...) methods instead.)

      For example:

       public void doSomething(String foo, int bar) {
           LOGGER.entry(foo, bar);
           // do something
       }
       

      The use of methods such as this are more effective when combined with aspect-oriented programming or other bytecode manipulation tools. It can be rather tedious (and messy) to use this type of method manually.

      Specified by:
      entry in interface Logger
      Overrides:
      entry in class AbstractLogger
      Parameters:
      params - The parameters to the method.
    • exit

      public void exit()
      Description copied from interface: Logger
      Logs exit from a method. Used for methods that do not return anything.
      Specified by:
      exit in interface Logger
      Overrides:
      exit in class AbstractLogger
    • exit

      public <R> R exit(R result)
      Description copied from interface: Logger
      Logs exiting from a method with the result. This may be coded as:
       return LOGGER.exit(myResult);
       
      Specified by:
      exit in interface Logger
      Overrides:
      exit in class AbstractLogger
      Type Parameters:
      R - The type of the parameter and object being returned.
      Parameters:
      result - The result being returned from the method call.
      Returns:
      the result.
    • throwing

      public <T extends Throwable> T throwing(T t)
      Description copied from interface: Logger
      Logs a Throwable to be thrown at the ERROR level. This may be coded as:
       throw logger.throwing(myException);
       
      Specified by:
      throwing in interface Logger
      Overrides:
      throwing in class AbstractLogger
      Type Parameters:
      T - the Throwable type.
      Parameters:
      t - The Throwable.
      Returns:
      the Throwable.