public void log ( long now , Level level , Throwable cause , String stemformat , Object ... args ) { if ( now - m_lastLogTime > m_maxLogIntervalMillis ) { synchronized ( this ) { if ( now - m_lastLogTime > m_maxLogIntervalMillis ) { String message = formatMessage ( cause , stemformat , args ) ; switch ( level ) { case DEBUG : m_logger . debug ( message ) ; break ; case ERROR : m_logger . error ( message ) ; break ; case FATAL : m_logger . fatal ( message ) ; break ; case INFO : m_logger . info ( message ) ; break ; case TRACE : m_logger . trace ( message ) ; break ; case WARN : m_logger . warn ( message ) ; break ; } m_lastLogTime = now ; } } } }
This variant delays the formatting of the string message until it is actually logged