Package de.mhus.lib.core.logging
Class Log
- java.lang.Object
-
- de.mhus.lib.core.logging.Log
-
- Direct Known Subclasses:
FileLogger,PrintWriterLog,YLogger
public class Log extends Object
Got the interface from apache-commons-logging. I need to switch because its not working in eclipse plugins correctly.- Author:
- mikehummel
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLog.LEVEL
-
Field Summary
Fields Modifier and Type Field Description protected LogEngineengineprotected static LevelMapperlevelMapperprotected booleanlocalTraceprotected static intmaxMsgSizeprotected Stringnameprotected static ParameterMapperparameterMapper
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidd(Object... msg)Log a message in debug, it will automatically append the objects if debug is enabled.voide(Object... msg)Log a message in error, it will automatically append the objects if debug is enabled.voidf(Object... msg)Log a message in info, it will automatically append the objects if debug is enabled.static LoggetLog(Object owner)StringgetName()ParameterMappergetParameterMapper()voidi(Object... msg)Log a message in info, it will automatically append the objects if debug is enabled.booleanisLevelEnabled(Log.LEVEL level)Return if the given level is enabled.booleanisLocalTrace()static booleanisStacktraceTrace()voidlog(Log.LEVEL level, Object... msg)protected voidprepare(StringBuilder sb)voidsetLocalTrace(boolean localTrace)static voidsetStacktraceTrace(boolean stacktraceTrace)voidt(Object... msg)Log a message in trace, it will automatically append the objects if trace is enabled.StringtoString()voidupdate()voidw(Object... msg)Log a message in warn, it will automatically append the objects if debug is enabled.
-
-
-
Field Detail
-
localTrace
protected boolean localTrace
-
name
protected String name
-
levelMapper
protected static LevelMapper levelMapper
-
parameterMapper
protected static ParameterMapper parameterMapper
-
engine
protected LogEngine engine
-
maxMsgSize
protected static int maxMsgSize
-
-
Constructor Detail
-
Log
public Log(Object owner)
-
-
Method Detail
-
t
public void t(Object... msg)
Log a message in trace, it will automatically append the objects if trace is enabled. Can Also add a trace. This is the local trace method. The trace will only written if the local trace is switched on.- Parameters:
msg-
-
d
public void d(Object... msg)
Log a message in debug, it will automatically append the objects if debug is enabled. Can Also add a trace.- Parameters:
msg-
-
i
public void i(Object... msg)
Log a message in info, it will automatically append the objects if debug is enabled. Can Also add a trace.- Parameters:
msg-
-
w
public void w(Object... msg)
Log a message in warn, it will automatically append the objects if debug is enabled. Can Also add a trace.- Parameters:
msg-
-
e
public void e(Object... msg)
Log a message in error, it will automatically append the objects if debug is enabled. Can Also add a trace.- Parameters:
msg-
-
f
public void f(Object... msg)
Log a message in info, it will automatically append the objects if debug is enabled. Can Also add a trace.- Parameters:
msg-
-
prepare
protected void prepare(StringBuilder sb)
-
setLocalTrace
public void setLocalTrace(boolean localTrace)
-
isLocalTrace
public boolean isLocalTrace()
-
getName
public String getName()
-
update
public void update()
-
getParameterMapper
public ParameterMapper getParameterMapper()
-
isLevelEnabled
public boolean isLevelEnabled(Log.LEVEL level)
Return if the given level is enabled. This function also uses the levelMapper to find the return value. Instead of the is...Enabled().- Parameters:
level-- Returns:
- true if level is enabled
-
close
public void close()
-
isStacktraceTrace
public static boolean isStacktraceTrace()
-
setStacktraceTrace
public static void setStacktraceTrace(boolean stacktraceTrace)
-
-