code: public synchronized void writeToLog(Session session, String statement) {
  
          if (logStatements && log != null) {
              log.writeStatement(session, statement);
          }
      }
docs: Records a Log entry for the specified SQL statement, on behalf of
  the specified Session object.
  
  @param  session the Session object for which to record the Log
  entry
  @param  statement the SQL statement to Log
  @throws  HsqlException if there is a problem recording the entry