Package pt.opensoft.logging

Examples of pt.opensoft.logging.Logger


  public boolean execute () throws SQLException {
    Timer timer = new Timer();
    timer.start();
    boolean result = false;
    Exception ex = null;
    Logger logger = _dbc.getLogger();
    logger.push("execute");
    try {
      result = ((CallableStatement) _stmt).execute();
        } catch (SQLException e) {
      ex = e;
      throw e;
    } finally {
            _dbc.setDbChanged(true);
      logger.push(String.valueOf(result));
      boolean tooLong = (_dbc.getThreshold() > 0 && timer.ellapsed() > _dbc.getThreshold());
            if (tooLong) logger.push("too long");
      if (ex != null) {
        logger.error(timer.ellapsed(), getSQLString() + " -> " + ex.getMessage());
      } else if (tooLong) {
        logger.warning(timer.ellapsed(), getSQLString());
      } else {
        logger.debug(timer.ellapsed(), getSQLString());
      }
    }
    return result;
  }
View Full Code Here

TOP

Related Classes of pt.opensoft.logging.Logger

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.