void clear ( ) { // This is volatile, read once for performance. final String name = loggerName ; if ( name != null ) { CHANGE_LOGGER_CONTEXT_LOCK . lock ( ) ; try { loggerContext . stop ( ) ; final Logger logger = loggerContext . getLogger ( org . slf4j . Logger . ROOT_LOGGER_NAME ) ; logger . detachAndStopAllAppenders ( ) ; // Additional cleanup/reset for this name configureLoggers ( name ) ; } finally { CHANGE_LOGGER_CONTEXT_LOCK . unlock ( ) ; } StatusPrinter . setPrintStream ( System . out ) ; } }
This method is designed to be used by unit tests only .