PageRenderTime 42ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/src/main/java/com/atlassian/util/integration/ProfilingP6Logger.java

https://bitbucket.org/atlassian/atlassian-profiling
Java | 38 lines | 30 code | 8 blank | 0 comment | 2 complexity | 05538bbbd56a872a0a10d571d77a02a1 MD5 | raw file
  1. package com.atlassian.util.integration;
  2. import com.atlassian.util.profiling.UtilTimerStack;
  3. import com.p6spy.engine.logging.appender.P6Logger;
  4. import org.slf4j.Logger;
  5. import org.slf4j.LoggerFactory;
  6. public class ProfilingP6Logger implements P6Logger
  7. {
  8. private static final Logger log = LoggerFactory.getLogger(ProfilingP6Logger.class);
  9. public void logSQL(int now, String elapsed, long connectionId, String category, String prepared, String sql)
  10. {
  11. if ("statement".equals(category))
  12. {
  13. String logEntry = now + "|" + elapsed + "|" + (connectionId == -1 ? "" : String.valueOf(connectionId)) + "|" + category + "|" + sql;
  14. UtilTimerStack.push(logEntry);
  15. UtilTimerStack.pop(logEntry); //todo - specify the elapsed time.
  16. }
  17. }
  18. public void logException(Exception e)
  19. {
  20. log.debug("", e);
  21. }
  22. public void logText(String s)
  23. {
  24. log.debug(s);
  25. }
  26. public String getLastEntry()
  27. {
  28. return null;
  29. }
  30. }