@Test public void truncateShortLines() throws Exception { for (int i = 0; i < 20; i++) { String s = ""; for (int lines = 0; lines < ThreadLocalRandom.current().nextInt(5, 10); lines++) { s += "\n"; s += CommonUtils.randomAlphaNumString( ThreadLocalRandom.current().nextInt(1, LogUtils.MAX_TRUNCATED_LENGTH + 1)); } assertEquals(s, LogUtils.truncateMessageLineLength(s)); } }
public static String truncateMessageLineLength(Object message) { return truncateMessageLineLength(message, MAX_TRUNCATED_LENGTH); }
LogUtils { public static String truncateMessageLineLength(Object message) { return truncateMessageLineLength(message, MAX_TRUNCATED_LENGTH); } }
LogUtils { public static String truncateMessageLineLength(Object message) { return truncateMessageLineLength(message, MAX_TRUNCATED_LENGTH); } private  LogUtils(); }
LogUtils { public static String truncateMessageLineLength(Object message) { return truncateMessageLineLength(message, MAX_TRUNCATED_LENGTH); } private  LogUtils(); static LogInfo setLogLevel(String logName, String level); static void warnWithException(Logger logger, String message, Object ...args); static String truncateMessageLineLength(Object message); static String truncateMessageLineLength(Object message, int maxLineLength); }
LogUtils { public static String truncateMessageLineLength(Object message) { return truncateMessageLineLength(message, MAX_TRUNCATED_LENGTH); } private  LogUtils(); static LogInfo setLogLevel(String logName, String level); static void warnWithException(Logger logger, String message, Object ...args); static String truncateMessageLineLength(Object message); static String truncateMessageLineLength(Object message, int maxLineLength); static final int MAX_TRUNCATED_LENGTH; }