Package org.bgerp.util

# Class Log

java.lang.Object
org.bgerp.util.Log

Direct Known Subclasses:
  `Log`

public class Log extends Object
Logging wrapper around Log4j version 1 with additional functions from version 2.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `MSG_DEPRECATED_METHOD_WAS_CALLED`
  `static final String`
  `MSG_WS_CREATE_NEW_INSTANCE_INSTEAD`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `Log(org.apache.log4j.Logger logger)`
  Make private later, temporary protected for backward compatible inherited class.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `debug(String message, Object... args)`
  Executes `log(Priority, String, Object...)` with `Level.DEBUG`
  `void`
  `error(String message, Object... args)`
  Executes `log(Priority, String, Object...)` with `Level.ERROR`.
  `void`
  `error(String message, Throwable e)`
  Logs error message and stack trace.
  `void`
  `error(Throwable e)`
  Logs error message from `e` and stack trace.
  `static String`
  `format(String message, Object... args)`
  Formats message using pattern with substitutions.
  `static Log`
  `getLog()`
  Using `StackLocatorUtil` gets the caller's object and logger for its class.
  `static Log`
  `getLog(Class<?> clazz)`
  Class connected logger.
  `void`
  `info(String message, Object... args)`
  Executes `log(Priority, String, Object...)` with `Level.INFO`.
  `boolean`
  `isDebugEnabled()`
  `final void`
  `log(org.apache.log4j.Priority level, Object message)`
  Wraps function to `Logger`.
  `void`
  `trace(String message, Object... params)`
  Executes `log(Priority, String, Object...)` with `Level.TRACE`
  `void`
  `warn(String message, Object... args)`
  Executes `log(Priority, String, Object...)` with `Level.WARN`.
  `void`
  `warnd(String message, Object... args)`
  Special warn call for deprecation messages.
  `void`
  `warndClass(Class<?> deprecatedClass, Class<?> actualClass)`
  Deprecation warning for a created class instance
  `void`
  `warndJsp(String deprecatedCall, String actionCall)`
  Deprecation warning for a JSP call
  `void`
  `warndMethod(String deprecatedName)`
  Deprecation warning for a called method
  `void`
  `warndMethod(String deprecatedName, String actualName)`
  Deprecation warning for a called method

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### MSG_DEPRECATED_METHOD_WAS_CALLED

    public static final String MSG_DEPRECATED_METHOD_WAS_CALLED
    See Also:
      - Constant Field Values

  - ### MSG_WS_CREATE_NEW_INSTANCE_INSTEAD

    public static final String MSG_WS_CREATE_NEW_INSTANCE_INSTEAD
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### Log

    protected Log(org.apache.log4j.Logger logger)
    Make private later, temporary protected for backward compatible inherited class.

- ## Method Details

  - ### getLog

    public static Log getLog(Class<?> clazz)
    Class connected logger.
    Parameters:
      `clazz` - the class.
    Returns:
      logger configured for `clazz`

  - ### getLog

    public static Log getLog()
    Using `StackLocatorUtil` gets the caller's object and logger for its class.
    Returns:
      logger configured for the caller object's class.

  - ### format

    public static String format(String message, Object... args)
    Formats message using pattern with substitutions.
    Parameters:
      `message` - format using `FormattedMessage`, supports both `&#123;&#125;` and `%s` substitutions.
      `args` - parameters for replacements in `message`.
    Returns:

  - ### trace

    public void trace(String message, Object... params)
    Executes `log(Priority, String, Object...)` with `Level.TRACE`

  - ### debug

    public void debug(String message, Object... args)
    Executes `log(Priority, String, Object...)` with `Level.DEBUG`

  - ### isDebugEnabled

    public boolean isDebugEnabled()
    Returns:
      is `Level.DEBUG` enabled.

  - ### info

    public void info(String message, Object... args)
    Executes `log(Priority, String, Object...)` with `Level.INFO`.

  - ### warn

    public void warn(String message, Object... args)
    Executes `log(Priority, String, Object...)` with `Level.WARN`.

  - ### warnd

    public void warnd(String message, Object... args)
    Special warn call for deprecation messages.
    Parameters:
      `message` - the message text pattern.
      `args` -

  - ### warndMethod

    public void warndMethod(String deprecatedName, String actualName)
    Deprecation warning for a called method
    Parameters:
      `deprecatedName` - the deprecated method name
      `actualName` - the actual method name or `null` if no such exists

  - ### warndMethod

    public void warndMethod(String deprecatedName)
    Deprecation warning for a called method
    Parameters:
      `deprecatedName` - the deprecated method name

  - ### warndClass

    public void warndClass(Class<?> deprecatedClass, Class<?> actualClass)
    Deprecation warning for a created class instance
    Parameters:
      `deprecatedClass` - the deprecated class
      `actualClass` - the actual ones

  - ### warndJsp

    public void warndJsp(String deprecatedCall, String actionCall)
    Deprecation warning for a JSP call
    Parameters:
      `deprecatedName` - the deprecated call string
      `actualName` - the actual call string

  - ### error

    public void error(String message, Object... args)
    Executes `log(Priority, String, Object...)` with `Level.ERROR`.

  - ### error

    public void error(Throwable e)
    Logs error message from `e` and stack trace.
    Parameters:
      `e` - the exception.

  - ### error

    public void error(String message, Throwable e)
    Logs error message and stack trace.
    Parameters:
      `message` - message text.
      `e` - exception.

  - ### log

    public final void log(org.apache.log4j.Priority level, Object message)
    Wraps function to `Logger`.
    Parameters:
      `level` -
      `message` -