@Test public void testFindMaxLevelLength() { int max = RoboconfLogFormatter.findMaxLevelLength(); Assert.assertTrue( max >= Level.ALL.toString().length()); Assert.assertTrue( max >= Level.CONFIG.toString().length()); Assert.assertTrue( max >= Level.FINE.toString().length()); Assert.assertTrue( max >= Level.FINER.toString().length()); Assert.assertTrue( max >= Level.FINEST.toString().length()); Assert.assertTrue( max >= Level.INFO.toString().length()); Assert.assertTrue( max >= Level.OFF.toString().length()); Assert.assertTrue( max >= Level.SEVERE.toString().length()); Assert.assertTrue( max >= Level.WARNING.toString().length()); }
static int findMaxLevelLength() { Level[] levels = new Level[] { Level.ALL, Level.CONFIG, Level.FINE, Level.FINER, Level.FINEST, Level.INFO, Level.OFF, Level.SEVERE, Level.WARNING }; int result = -1; for( Level level : levels ) result = Math.max( result, level.toString().length()); return result; }
RoboconfLogFormatter extends Formatter { static int findMaxLevelLength() { Level[] levels = new Level[] { Level.ALL, Level.CONFIG, Level.FINE, Level.FINER, Level.FINEST, Level.INFO, Level.OFF, Level.SEVERE, Level.WARNING }; int result = -1; for( Level level : levels ) result = Math.max( result, level.toString().length()); return result; } }
RoboconfLogFormatter extends Formatter { static int findMaxLevelLength() { Level[] levels = new Level[] { Level.ALL, Level.CONFIG, Level.FINE, Level.FINER, Level.FINEST, Level.INFO, Level.OFF, Level.SEVERE, Level.WARNING }; int result = -1; for( Level level : levels ) result = Math.max( result, level.toString().length()); return result; }  }
RoboconfLogFormatter extends Formatter { static int findMaxLevelLength() { Level[] levels = new Level[] { Level.ALL, Level.CONFIG, Level.FINE, Level.FINER, Level.FINEST, Level.INFO, Level.OFF, Level.SEVERE, Level.WARNING }; int result = -1; for( Level level : levels ) result = Math.max( result, level.toString().length()); return result; }  @Override String format( LogRecord record ); }
RoboconfLogFormatter extends Formatter { static int findMaxLevelLength() { Level[] levels = new Level[] { Level.ALL, Level.CONFIG, Level.FINE, Level.FINER, Level.FINEST, Level.INFO, Level.OFF, Level.SEVERE, Level.WARNING }; int result = -1; for( Level level : levels ) result = Math.max( result, level.toString().length()); return result; }  @Override String format( LogRecord record );  }