{
final ByteArrayOutputStream output = new ByteArrayOutputStream();
final StreamTarget other = new StreamTarget( output, FORMATTER );
final MemoryTarget target = new MemoryTarget( other, 10, Priority.FATAL_ERROR );
final Logger logger = getNewLogger( target );
//Head output should not be pushed yet
final String head = getResult( output );
assertEquals( "Targets Head output", "", head );
//Not pushed yet
logger.debug( M1 );
final String result1 = getResult( output );
assertEquals( "Targets R1 debug output", "", result1 );
target.push();
final String resultPP = getResult( output );
assertEquals( "Targets HEAD+R1 debug output", HEAD + R1, resultPP );
logger.debug( M2 );
final String result2 = getResult( output );
logger.debug( M3 );
final String result3 = getResult( output );
//fatal error triggers a push
logger.fatalError( M3 );
final String result4 = getResult( output );
assertEquals( "Targets R2 debug output", "", result2 );
assertEquals( "Targets R3 debug output", "", result3 );
assertEquals( "Targets R3 debug output", R2 + R3 + R3, result4 );