com.j256.ormlite.logger
Class LocalLog

java.lang.Object
  extended by com.j256.ormlite.logger.LocalLog
All Implemented Interfaces:
Log

public class LocalLog
extends Object
implements Log

Class which implements our Log interface so we can bypass external logging classes if they are not available.

You can set the log level by setting the System.setProperty(LocalLog.LOCAL_LOG_LEVEL_PROPERTY, "trace"). Acceptable values are: TRACE, DEBUG, INFO, WARN, ERROR, and FATAL. You can also redirect the log to a file by setting the System.setProperty(LocalLog.LOCAL_LOG_FILE_PROPERTY, "log.out"). Otherwise, log output will go to stdout.

Author:
graywatson

Nested Class Summary
static class LocalLog.Level
          Our log levels.
 
Field Summary
static String LOCAL_LOG_FILE_PROPERTY
           
static String LOCAL_LOG_LEVEL_PROPERTY
           
 
Constructor Summary
LocalLog(String className)
           
 
Method Summary
 void debug(String msg)
          Log a debug message.
 void debug(String msg, Throwable throwable)
          Log a debug message with a throwable.
 void error(String msg)
          Log a error message.
 void error(String msg, Throwable throwable)
          Log a error message with a throwable.
 void fatal(String msg)
          Log a fatal message.
 void fatal(String msg, Throwable throwable)
          Log a fatal message with a throwable.
 void info(String msg)
          Log a info message.
 void info(String msg, Throwable throwable)
          Log a info message with a throwable.
 boolean isDebugEnabled()
          Returns true if the log mode is in debug or higher.
 boolean isErrorEnabled()
          Returns true if the log mode is in error or higher.
 boolean isFatalEnabled()
          Returns true if the log mode is in fatal or higher.
 boolean isInfoEnabled()
          Returns true if the log mode is in info or higher.
 boolean isTraceEnabled()
          Returns true if the log mode is in trace or higher.
 boolean isWarnEnabled()
          Returns true if the log mode is in warn or higher.
 void trace(String msg)
          Log a trace message.
 void trace(String msg, Throwable throwable)
          Log a trace message with a throwable.
 void warn(String msg)
          Log a warn message.
 void warn(String msg, Throwable throwable)
          Log a warn message with a throwable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCAL_LOG_LEVEL_PROPERTY

public static final String LOCAL_LOG_LEVEL_PROPERTY
See Also:
Constant Field Values

LOCAL_LOG_FILE_PROPERTY

public static final String LOCAL_LOG_FILE_PROPERTY
See Also:
Constant Field Values
Constructor Detail

LocalLog

public LocalLog(String className)
Method Detail

isTraceEnabled

public boolean isTraceEnabled()
Description copied from interface: Log
Returns true if the log mode is in trace or higher.

Specified by:
isTraceEnabled in interface Log

isDebugEnabled

public boolean isDebugEnabled()
Description copied from interface: Log
Returns true if the log mode is in debug or higher.

Specified by:
isDebugEnabled in interface Log

isInfoEnabled

public boolean isInfoEnabled()
Description copied from interface: Log
Returns true if the log mode is in info or higher.

Specified by:
isInfoEnabled in interface Log

isWarnEnabled

public boolean isWarnEnabled()
Description copied from interface: Log
Returns true if the log mode is in warn or higher.

Specified by:
isWarnEnabled in interface Log

isErrorEnabled

public boolean isErrorEnabled()
Description copied from interface: Log
Returns true if the log mode is in error or higher.

Specified by:
isErrorEnabled in interface Log

isFatalEnabled

public boolean isFatalEnabled()
Description copied from interface: Log
Returns true if the log mode is in fatal or higher.

Specified by:
isFatalEnabled in interface Log

trace

public void trace(String msg)
Description copied from interface: Log
Log a trace message.

Specified by:
trace in interface Log

trace

public void trace(String msg,
                  Throwable throwable)
Description copied from interface: Log
Log a trace message with a throwable.

Specified by:
trace in interface Log

debug

public void debug(String msg)
Description copied from interface: Log
Log a debug message.

Specified by:
debug in interface Log

debug

public void debug(String msg,
                  Throwable throwable)
Description copied from interface: Log
Log a debug message with a throwable.

Specified by:
debug in interface Log

info

public void info(String msg)
Description copied from interface: Log
Log a info message.

Specified by:
info in interface Log

info

public void info(String msg,
                 Throwable throwable)
Description copied from interface: Log
Log a info message with a throwable.

Specified by:
info in interface Log

warn

public void warn(String msg)
Description copied from interface: Log
Log a warn message.

Specified by:
warn in interface Log

warn

public void warn(String msg,
                 Throwable throwable)
Description copied from interface: Log
Log a warn message with a throwable.

Specified by:
warn in interface Log

error

public void error(String msg)
Description copied from interface: Log
Log a error message.

Specified by:
error in interface Log

error

public void error(String msg,
                  Throwable throwable)
Description copied from interface: Log
Log a error message with a throwable.

Specified by:
error in interface Log

fatal

public void fatal(String msg)
Description copied from interface: Log
Log a fatal message.

Specified by:
fatal in interface Log

fatal

public void fatal(String msg,
                  Throwable throwable)
Description copied from interface: Log
Log a fatal message with a throwable.

Specified by:
fatal in interface Log


Copyright © 2010. All Rights Reserved.