Package simpleorm.utils
Class SLog
java.lang.Object
simpleorm.utils.SLog
- Direct Known Subclasses:
SLogSlf4j
Very simple logging system.
Logging calls are all made SLog.log.method so overriding this
class with a subclass of SLog provides full control of the logging if really
necessary.
Most logging happens in the context of a session, which should be used to identify and separate multiple threads in a log file. However, some logging has no session or dataset, so we cannot simply associate the session with the slog object, and the
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringarrayToString(Object[] array) voidconnections(String msg) voidbooleanFor detailed temporary traces during development only.booleanset/get per field.booleanbooleanvoidvoidintgetLevel()static SLogprotected voidvoidFor messages that are the ouput, eg.static SLognewSLog()voidprotected StringvoidsetLevel(int level) voidsetSession(SSessionI session) static voidsetSlogClass(Class<? extends SLog> slogClass) voidvoid
-
Constructor Details
-
SLog
public SLog()
-
-
Method Details
-
newSLog
-
error
-
warn
-
connections
-
enableUpdates
public boolean enableUpdates() -
updates
-
enableQueries
public boolean enableQueries() -
queries
-
enableFields
public boolean enableFields()set/get per field. enableFields enables the trace line to be surounded by an if test which is important as fields are an inner loop trace and the StringBuffer concatenation can be very expensive! -
fields
-
enableDebug
public boolean enableDebug()For detailed temporary traces during development only. -
debug
-
message
For messages that are the ouput, eg. of unit test programs. Never disabled. -
log
-
getStream
-
arrayToString
-
sessionToString
-
getSessionlessLogger
-
getLevel
public int getLevel() -
setLevel
public void setLevel(int level) -
getSlogClass
-
setSlogClass
-
getSession
-
setSession
-