/src/main/java/com/atlassian/util/integration/ProfilingP6Logger.java
Java | 38 lines | 30 code | 8 blank | 0 comment | 2 complexity | 05538bbbd56a872a0a10d571d77a02a1 MD5 | raw file
- package com.atlassian.util.integration;
- import com.atlassian.util.profiling.UtilTimerStack;
- import com.p6spy.engine.logging.appender.P6Logger;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- public class ProfilingP6Logger implements P6Logger
- {
- private static final Logger log = LoggerFactory.getLogger(ProfilingP6Logger.class);
- public void logSQL(int now, String elapsed, long connectionId, String category, String prepared, String sql)
- {
- if ("statement".equals(category))
- {
- String logEntry = now + "|" + elapsed + "|" + (connectionId == -1 ? "" : String.valueOf(connectionId)) + "|" + category + "|" + sql;
- UtilTimerStack.push(logEntry);
- UtilTimerStack.pop(logEntry); //todo - specify the elapsed time.
- }
- }
- public void logException(Exception e)
- {
- log.debug("", e);
- }
- public void logText(String s)
- {
- log.debug(s);
- }
- public String getLastEntry()
- {
- return null;
- }
- }