Package simpleorm.utils
Class SLogSlf4j
java.lang.Object
simpleorm.utils.SLog
simpleorm.utils.SLogSlf4j
- Direct Known Subclasses:
SormLog
An implementation of SLog to allow Simpleorm to log via Slf4j. Log level is then controlled by slf4j, not by
SLog.slog.level.
Mapping between SLog and slf4j log levels is:
SLog Slf4j - Marker ---------------- -------------------- debug (30) debug warn warn message warn error error connections (10) info updates (20) debug SORM_UPDATE queries (30) debug SORM_QUERY fields (40) trace SORM_FIELD
To use this logging API, you must: 1) SLog.setSlogClass(SLogSlf4j.class); somewhere early in you app (in you servlet init sequence for example) 2) make sure you have a slf4j implementation in your classpath (logback, simplelogger, etc.)
Configure slf4j, for examples, @see http://www.slf4j.org/
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
arrayToString
(Object[] array) void
connections
(String msg) void
boolean
For detailed temporary traces during development only.boolean
set/get per field.boolean
boolean
void
void
void
For messages that are the output, eg.void
void
void
Methods inherited from class simpleorm.utils.SLog
getLevel, getSession, getSessionlessLogger, getSlogClass, getStream, log, newSLog, sessionToString, setLevel, setSession, setSlogClass
-
Field Details
-
level
public int level
-
-
Constructor Details
-
SLogSlf4j
public SLogSlf4j()
-
-
Method Details
-
error
-
warn
-
connections
- Overrides:
connections
in classSLog
-
enableUpdates
public boolean enableUpdates()- Overrides:
enableUpdates
in classSLog
-
updates
-
enableQueries
public boolean enableQueries()- Overrides:
enableQueries
in classSLog
-
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!- Overrides:
enableFields
in classSLog
-
fields
-
enableDebug
public boolean enableDebug()For detailed temporary traces during development only.- Overrides:
enableDebug
in classSLog
-
debug
-
message
For messages that are the output, eg. of unit test programs. Never disabled. -
arrayToString
-