Klasse Logger

java.lang.Object
net.simplace.core.logging.Logger

public class Logger extends Object
Singleton logger to be used to organize the logging process. Logger stores information about the log-level of the application It can be used to trigger different log categories use like: if (Logger.isERROR()) Logger.ERROR("message", aException, this); Additional features: - for performance reasons you can always log to the root logger. Use Method "setUseLOGGERclazz" to false if you want to do so. - you can avoid the logger to print stack traces if you set the Logger instance to true in "setDisableStackTrace".
Autor:
Andreas Enders
  • Verschachtelte Klassen - Übersicht

    Verschachtelte Klassen
    Modifizierer und Typ
    Klasse
    Beschreibung
    static enum 
     
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
     
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    static void
    DEBUG(String aStringToLog, Object aThisInstance)
    debug log without exception stack
    static void
    DEBUG(String aStringToLog, Throwable aExceptionToLog, Object aThisInstance)
    debug log with exception stack
    static void
    ERROR(String aStringToLog, Throwable aException, Object This)
    error log with exception stack
    static void
    FATAL(String aStringToLog, Throwable aExceptionToLog, Object aThisInstance)
    fatal log with exception stack
    static void
    INFO(String aStringToLog, Object aThisInstance)
    info log without exception stack
    static void
    INFO(String aStringToLog, Throwable aExceptionToLog, Object aThisInstance)
    info log with exception stack
    static boolean
    if Debug should be logged returns true
    static boolean
    if Error should be logged returns true
    static boolean
    if Info should be logged returns true
    static boolean
    if Debug should be logged returns true
    static boolean
    if Warn should be logged returns true
    static void
    setDisableStackTrace(boolean aDisableStackTrace)
    avoid the logger to print stack traces (true) default (false)
    static void
    setLogLevel(int aLogLevel)
    Use a numeric index to set a log level.
    static void
    set the log level for the system manually
    static void
    setUseLOGGERclazz(boolean aUseLOGGERclazz)
    for performance reasons you can always log to the root logger (false) default is (true)
    static void
    WARN(String aStringToLog, Object aThisInstance)
    warn log without exception stack
    static void
    WARN(String aStringToLog, Throwable aExceptionToLog, Object aThisInstance)
    warn log with exception stack

    Von Klasse geerbte Methoden java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Konstruktordetails

    • Logger

      public Logger()
  • Methodendetails

    • setLogLevel

      public static void setLogLevel(Logger.LOGLEVEL aLogLevel)
      set the log level for the system manually
      Parameter:
      aLogLevel -
    • setLogLevel

      public static void setLogLevel(int aLogLevel)
      Use a numeric index to set a log level. Used for external calls from e.g. R.

      Use LOGLEVEL.values() to see what log levels the indices correspond to.

      Parameter:
      aLogLevel -
    • setUseLOGGERclazz

      public static void setUseLOGGERclazz(boolean aUseLOGGERclazz)
      for performance reasons you can always log to the root logger (false) default is (true)
      Parameter:
      aUseLOGGERclazz -
    • setDisableStackTrace

      public static void setDisableStackTrace(boolean aDisableStackTrace)
      avoid the logger to print stack traces (true) default (false)
      Parameter:
      aDisableStackTrace - the disableStackTrace to set
    • isTRACE

      public static boolean isTRACE()
      if Debug should be logged returns true
      Gibt zurück:
      the Trace
    • isDEBUG

      public static boolean isDEBUG()
      if Debug should be logged returns true
      Gibt zurück:
      the dEBUG
    • isINFO

      public static boolean isINFO()
      if Info should be logged returns true
      Gibt zurück:
      the iNFO
    • isWARN

      public static boolean isWARN()
      if Warn should be logged returns true
      Gibt zurück:
      the wARN
    • isERROR

      public static boolean isERROR()
      if Error should be logged returns true
      Gibt zurück:
      the eRROR
    • DEBUG

      public static void DEBUG(String aStringToLog, Throwable aExceptionToLog, Object aThisInstance)
      debug log with exception stack
      Parameter:
      aStringToLog -
      aExceptionToLog -
      aThisInstance -
    • DEBUG

      public static void DEBUG(String aStringToLog, Object aThisInstance)
      debug log without exception stack
      Parameter:
      aStringToLog -
      aThisInstance -
    • INFO

      public static void INFO(String aStringToLog, Throwable aExceptionToLog, Object aThisInstance)
      info log with exception stack
      Parameter:
      aStringToLog -
      aExceptionToLog -
      aThisInstance -
    • INFO

      public static void INFO(String aStringToLog, Object aThisInstance)
      info log without exception stack
      Parameter:
      aStringToLog -
      aThisInstance -
    • WARN

      public static void WARN(String aStringToLog, Throwable aExceptionToLog, Object aThisInstance)
      warn log with exception stack
      Parameter:
      aStringToLog -
      aExceptionToLog -
      aThisInstance -
    • WARN

      public static void WARN(String aStringToLog, Object aThisInstance)
      warn log without exception stack
      Parameter:
      aStringToLog -
      aThisInstance -
    • ERROR

      public static void ERROR(String aStringToLog, Throwable aException, Object This)
      error log with exception stack
      Parameter:
      aStringToLog -
      aException -
      This -
    • FATAL

      public static void FATAL(String aStringToLog, Throwable aExceptionToLog, Object aThisInstance)
      fatal log with exception stack
      Parameter:
      aStringToLog -
      aExceptionToLog -
      aThisInstance -