/** * Returns the id of this request log as a string. * If called on an empty request log context, it initializes it. * * @return the log id */ public static String getId() { RequestLog current = RLOG.get(); if (current.info == null) { current.init(); } return current.logId; }
/** * Start a stopwatch. * Time is accumulated if the stopwatch is already registered * * @param timePhaseName the name of this stopwatch * * @return The stopwatch */ public static TimedPhase startTiming(String timePhaseName) { RequestLog current = RLOG.get(); TimedPhase timePhase = current.times.get(timePhaseName); if (timePhase == null) { // If it was the first phase in general, create logging context as well if (current.info == null) { current.init(); } timePhase = new TimedPhase(timePhaseName); current.times.put(timePhaseName, timePhase); } current.mostRecentTimer = timePhase; return timePhase.start(); }