Package org.compiere.util
Class CLogger
- java.lang.Object
-
- java.util.logging.Logger
-
- org.compiere.util.CLogger
-
public class CLogger extends Logger
idempiere Logger- Version:
- $Id: CLogger.java,v 1.3 2006/08/09 16:38:47 jjanke Exp $
- Author:
- Jorg Janke
-
-
Field Summary
-
Fields inherited from class java.util.logging.Logger
global, GLOBAL_LOGGER_NAME
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CLogger
get()
Get default idempiere Logger.static CLogger
getCLogger(Class<?> clazz)
Get Loggerstatic CLogger
getCLogger(String className)
Get Loggerstatic CLogger
getCLogger(String className, boolean usePackageLevel)
Get Loggerstatic Throwable
getRootCause(Throwable t)
Get root causestatic ValueNamePair
peekError()
Peek Error from Stackstatic Exception
peekException()
Peek Exception from Stackstatic void
resetLast()
Reset Saved Messages/Errors/Infostatic ValueNamePair
retrieveError()
Get Error from Stackstatic String
retrieveErrorString(String defaultMsg)
Get Error message from stackstatic Exception
retrieveException()
Get Error from Stackstatic ValueNamePair
retrieveInfo()
Get Info from Stackstatic ValueNamePair
retrieveWarning()
Get Warning from Stackstatic String
retrieveWarningString(String defaultMsg)
Get Warning message from stackboolean
saveError(String AD_Message, Exception ex)
Set and issue Error and save as ValueNamePairboolean
saveError(String AD_Message, Exception ex, boolean issueError)
Set and issue (if specified) Error and save as ValueNamePairboolean
saveError(String AD_Message, String message)
Set and issue Error and save as ValueNamePairboolean
saveError(String AD_Message, String message, boolean issueError)
Set Error and save as ValueNamePairboolean
saveInfo(String AD_Message, String message)
Save Info as ValueNamePairboolean
saveWarning(String AD_Message, String message)
Save Warning as ValueNamePair.String
toString()
String Representation-
Methods inherited from class java.util.logging.Logger
addHandler, config, config, entering, entering, entering, exiting, exiting, fine, fine, finer, finer, finest, finest, getAnonymousLogger, getAnonymousLogger, getFilter, getGlobal, getHandlers, getLevel, getLogger, getLogger, getName, getParent, getResourceBundle, getResourceBundleName, getUseParentHandlers, info, info, isLoggable, log, log, log, log, log, log, log, logp, logp, logp, logp, logp, logp, logrb, logrb, logrb, logrb, logrb, logrb, logrb, logrb, removeHandler, setFilter, setLevel, setParent, setResourceBundle, setUseParentHandlers, severe, severe, throwing, warning, warning
-
-
-
-
Method Detail
-
getCLogger
public static CLogger getCLogger(String className)
Get Logger- Parameters:
className
- class name- Returns:
- Logger
-
getCLogger
public static CLogger getCLogger(String className, boolean usePackageLevel)
Get Logger- Parameters:
className
- class nameusePackageLevel
-- Returns:
- Logger
-
getCLogger
public static CLogger getCLogger(Class<?> clazz)
Get Logger- Parameters:
clazz
- class name- Returns:
- Logger
-
get
public static CLogger get()
Get default idempiere Logger. Need to be used in serialized objects- Returns:
- logger
-
saveError
public boolean saveError(String AD_Message, String message)
Set and issue Error and save as ValueNamePair- Parameters:
AD_Message
- message keymessage
- clear text message- Returns:
- true (to avoid removal of method)
-
saveError
public boolean saveError(String AD_Message, Exception ex)
Set and issue Error and save as ValueNamePair- Parameters:
AD_Message
- message keyex
- exception- Returns:
- true (to avoid removal of method)
-
saveError
public boolean saveError(String AD_Message, Exception ex, boolean issueError)
Set and issue (if specified) Error and save as ValueNamePair- Parameters:
AD_Message
- message keyex
- exceptionissueError
- if true will issue an error- Returns:
- true (to avoid removal of method)
-
saveError
public boolean saveError(String AD_Message, String message, boolean issueError)
Set Error and save as ValueNamePair- Parameters:
AD_Message
- message keymessage
- clear text messageissueError
- print error message (default true)- Returns:
- true
-
retrieveError
public static ValueNamePair retrieveError()
Get Error from Stack- Returns:
- AD_Message as Value and Message as String
-
peekError
public static ValueNamePair peekError()
Peek Error from Stack- Returns:
- AD_Message as Value and Message as String
-
retrieveErrorString
public static String retrieveErrorString(String defaultMsg)
Get Error message from stack- Parameters:
defaultMsg
- default message (used when there are no errors on stack)- Returns:
- error message, or defaultMsg if there is not error message saved
- See Also:
author Teo Sarca, SC ARHIPAC SERVICE SRL
-
retrieveException
public static Exception retrieveException()
Get Error from Stack- Returns:
- last exception
-
peekException
public static Exception peekException()
Peek Exception from Stack- Returns:
- last exception
-
saveWarning
public boolean saveWarning(String AD_Message, String message)
Save Warning as ValueNamePair.- Parameters:
AD_Message
- message keymessage
- clear text message- Returns:
- true
-
retrieveWarningString
public static String retrieveWarningString(String defaultMsg)
Get Warning message from stack- Parameters:
defaultMsg
- default message (used when there are no warnings on stack)- Returns:
- error message, or defaultMsg if there is not error message saved
- See Also:
retrieveError()
-
retrieveWarning
public static ValueNamePair retrieveWarning()
Get Warning from Stack- Returns:
- AD_Message as Value and Message as String
-
saveInfo
public boolean saveInfo(String AD_Message, String message)
Save Info as ValueNamePair- Parameters:
AD_Message
- message keymessage
- clear text message- Returns:
- true
-
retrieveInfo
public static ValueNamePair retrieveInfo()
Get Info from Stack- Returns:
- AD_Message as Value and Message as String
-
resetLast
public static void resetLast()
Reset Saved Messages/Errors/Info
-
getRootCause
public static Throwable getRootCause(Throwable t)
Get root cause- Parameters:
t
-- Returns:
- Throwable
-
-