Class SLog

java.lang.Object
simpleorm.utils.SLog
Direct Known Subclasses:
SLogSlf4j

public class SLog extends Object
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 Details

    • SLog

      public SLog()
  • Method Details

    • newSLog

      public static SLog newSLog()
    • error

      public void error(String msg)
    • warn

      public void warn(String msg)
    • connections

      public void connections(String msg)
    • enableUpdates

      public boolean enableUpdates()
    • updates

      public void updates(String msg)
    • enableQueries

      public boolean enableQueries()
    • queries

      public void queries(String msg)
    • 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

      public void fields(String msg)
    • enableDebug

      public boolean enableDebug()
      For detailed temporary traces during development only.
    • debug

      public void debug(String msg)
    • message

      public void message(String msg)
      For messages that are the ouput, eg. of unit test programs. Never disabled.
    • log

      protected void log(String msg)
    • getStream

      public PrintStream getStream()
    • arrayToString

      public static String arrayToString(Object[] array)
    • sessionToString

      protected String sessionToString()
    • getSessionlessLogger

      public static SLog getSessionlessLogger()
    • getLevel

      public int getLevel()
    • setLevel

      public void setLevel(int level)
    • getSlogClass

      public static Class<? extends SLog> getSlogClass()
    • setSlogClass

      public static void setSlogClass(Class<? extends SLog> slogClass)
    • getSession

      public SSessionI getSession()
    • setSession

      public void setSession(SSessionI session)