Class 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
    • 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 name
        usePackageLevel -
        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 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,
                                 Exception ex,
                                 boolean issueError)
        Set and issue (if specified) Error and save as ValueNamePair
        Parameters:
        AD_Message - message key
        ex - exception
        issueError - 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 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
      • 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 key
        message - 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 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