Package org.bgerp.util
Class Log
java.lang.Object
org.bgerp.util.Log
- Direct Known Subclasses:
Log
Logging wrapper around Log4j version 1 with additional functions from version 2.
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
Log
(org.apache.log4j.Logger logger) Make private later, temporary protected for backward compatible inherited class. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Executeslog(Priority, String, Object...)
withLevel.DEBUG
void
Executeslog(Priority, String, Object...)
withLevel.ERROR
.void
Logs error message and stack trace.void
Logs error message frome
and stack trace.static String
Formats message using pattern with substitutions.static Log
getLog()
UsingStackLocatorUtil
gets the caller's object and logger for its class.static Log
Class connected logger.void
Executeslog(Priority, String, Object...)
withLevel.INFO
.boolean
final void
Wraps function toLogger
.void
Executeslog(Priority, String, Object...)
withLevel.TRACE
void
Executeslog(Priority, String, Object...)
withLevel.WARN
.void
Special warn call for deprecation messages.void
Writes deprecation warning for a JSP call.void
warndMethod
(String deprecatedName, String actualName) Writes deprecation warning for a called method.
-
Field Details
-
MSG_DEPRECATED_METHOD_WAS_CALLED
- See Also:
-
MSG_WS_CREATE_NEW_INSTANCE_INSTEAD
- See Also:
-
-
Constructor Details
-
Log
protected Log(org.apache.log4j.Logger logger) Make private later, temporary protected for backward compatible inherited class.
-
-
Method Details
-
getLog
Class connected logger.- Parameters:
clazz
- the class.- Returns:
- logger configured for
clazz
-
getLog
UsingStackLocatorUtil
gets the caller's object and logger for its class.- Returns:
- logger configured for the caller object's class.
-
format
Formats message using pattern with substitutions.- Parameters:
message
- format usingFormattedMessage
, supports both{}
and%s
substitutions.args
- parameters for replacements inmessage
.- Returns:
-
trace
Executeslog(Priority, String, Object...)
withLevel.TRACE
-
debug
Executeslog(Priority, String, Object...)
withLevel.DEBUG
-
isDebugEnabled
public boolean isDebugEnabled()- Returns:
- is
Level.DEBUG
enabled.
-
info
Executeslog(Priority, String, Object...)
withLevel.INFO
. -
warn
Executeslog(Priority, String, Object...)
withLevel.WARN
. -
warnd
Special warn call for deprecation messages.- Parameters:
message
- the message text pattern.args
-
-
warndMethod
Writes deprecation warning for a called method.- Parameters:
deprecatedName
- the deprecated method name.actualName
- the actual method name ornull
if no such exists.
-
warndJsp
Writes deprecation warning for a JSP call.- Parameters:
deprecatedName
- the deprecated call string.actualName
- the actual call string.
-
error
Executeslog(Priority, String, Object...)
withLevel.ERROR
. -
error
Logs error message frome
and stack trace.- Parameters:
e
- the exception.
-
error
Logs error message and stack trace.- Parameters:
message
- message text.e
- exception.
-
log
Wraps function toLogger
.- Parameters:
level
-message
-
-