Compiere 3.1

org.compiere.util
Class CLogger

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

public class CLogger
extends Logger
implements CompiereLogger, Serializable

Compiere 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 Compiere Logger.
static CLogger getCLogger(Class<?> clazz)
          Get Logger
static CLogger getCLogger(String className)
          Get Logger
static boolean hasError()
           
 boolean isLevelFinest()
          Is Finest Level
static void resetLast()
          Reset Saved Messages/Errors/Info
static ValueNamePair retrieveError()
          Get Error 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
 
Methods inherited from interface org.compiere.util.CompiereLogger
config, fine, finer, finest, info, severe, warning
 

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 Compiere 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

hasError

public static boolean hasError()
Returns:
Whether an error had been saved onto the stack.

retrieveError

public static ValueNamePair retrieveError()
Get Error from Stack

Returns:
AD_Message as Value and Message as String

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


isLevelFinest

public boolean isLevelFinest()
Is Finest Level

Specified by:
isLevelFinest in interface CompiereLogger
Returns:
true if finest or more

toString

public String toString()
String Representation

Overrides:
toString in class Object
Returns:
info

Compiere 3.1

Compiere® is a registered trademark of ComPiere, Inc. ©2004-2008 HumanFlash.com All rights reserved.