Adempiere 3.5.2a

org.compiere.util
Class CLogger

java.lang.Object
  extended by java.util.logging.Logger
      extended by org.compiere.util.CLogger
All Implemented Interfaces:
Serializable

public class CLogger
extends Logger
implements Serializable

Adempiere Logger

Version:
$Id: CLogger.java,v 1.3 2006/08/09 16:38:47 jjanke Exp $
Author:
Jorg Janke
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.logging.Logger
global, GLOBAL_LOGGER_NAME
 
Method Summary
static CLogger get()
          Get default Adempiere Logger.
static CLogger getCLogger(Class clazz)
          Get Logger
static CLogger getCLogger(String className)
          Get Logger
static Throwable getRootCause(Throwable t)
          Get root cause
static void resetLast()
          Reset Saved Messages/Errors/Info
static ValueNamePair retrieveError()
          Get Error from Stack
static String retrieveErrorString(String defaultMsg)
          Get Error message from stack
static Exception retrieveException()
          Get Error from Stack
static ValueNamePair retrieveInfo()
          Get Info from Stack
static ValueNamePair retrieveWarning()
          Get Warning from Stack
 boolean saveError(String AD_Message, Exception ex)
          Set and issue Error and save as ValueNamePair
 boolean saveError(String AD_Message, String message)
          Set and issue Error and save as ValueNamePair
 boolean saveError(String AD_Message, String message, boolean issueError)
          Set Error and save as ValueNamePair
 boolean saveInfo(String AD_Message, String message)
          Save Info as ValueNamePair
 boolean saveWarning(String AD_Message, String message)
          Save Warning as ValueNamePair.
 String toString()
          String Representation
 
Methods inherited from class java.util.logging.Logger
addHandler, config, entering, entering, entering, exiting, exiting, fine, finer, finest, getAnonymousLogger, getAnonymousLogger, getFilter, getHandlers, getLevel, getLogger, getLogger, getName, getParent, getResourceBundle, getResourceBundleName, getUseParentHandlers, info, isLoggable, log, log, log, log, log, logp, logp, logp, logp, logrb, logrb, logrb, logrb, removeHandler, setFilter, setLevel, setParent, setUseParentHandlers, severe, throwing, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getCLogger

public static CLogger getCLogger(String className)
Get Logger

Parameters:
className - class name
Returns:
Logger

getCLogger

public static CLogger getCLogger(Class clazz)
Get Logger

Parameters:
clazz - class name
Returns:
Logger

get

public static CLogger get()
Get default Adempiere 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 key
message - 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 key
ex - exception
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 key
message - clear text message
issueError - 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

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:
retrieveError()

retrieveException

public static Exception retrieveException()
Get Error from Stack

Returns:
last exception

saveWarning

public boolean saveWarning(String AD_Message,
                           String message)
Save Warning as ValueNamePair.

Parameters:
AD_Message - message key
message - clear text message
Returns:
true

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 key
message - 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

toString

public String toString()
String Representation

Overrides:
toString in class Object
Returns:
info

Adempiere 3.5.2a

Adempiere® is a registered trademark of ADempiere Business Inc. ©2004-2008 HumanFlash.com All rights reserved.