Code example for Logger

Methods: fine, isLoggable

0
    } 
 
    public static void trace(StaplerRequest req, StaplerResponse rsp, String msg) {
        if(isTraceEnabled(req))
            EvaluationTrace.get(req).trace(rsp,msg);
        if(LOGGER.isLoggable(Level.FINE))
            LOGGER.fine(msg);
    } 
 
    /** 
     * Checks if tracing is enabled for the given request. Tracing can be 
     * enabled globally with the "stapler.trace=true" system property. Tracing 
     * can be enabled per-request by setting "stapler.trace.per-request=true" 
     * and sending an "X-Stapler-Trace" header set to "true" with the request. 
     */ 
    public static boolean isTraceEnabled(StaplerRequest req) {
        if (TRACE)
            return true; 
 
        if (TRACE_PER_REQUEST && "true".equals(req.getHeader("X-Stapler-Trace")))
            return true;