HockeyLog { static String sanitizeTag(String tag) { if ((tag == null) || (tag.length() == 0) || (tag.length() > 23)) { tag = HOCKEY_TAG; } return tag; }  static int getLogLevel(); static void setLogLevel(int hockeyLogLevel); static void verbose(String message); static void verbose(String tag, String message); static void verbose(String message, Throwable throwable); static void verbose(String tag, String message, Throwable throwable); static void debug(String message); static void debug(String tag, String message); static void debug(String message, Throwable throwable); static void debug(String tag, String message, Throwable throwable); static void info(String message); static void info(String tag, String message); static void info(String message, Throwable throwable); static void info(String tag, String message, Throwable throwable); static void warn(String message); static void warn(String tag, String message); static void warn(String message, Throwable throwable); static void warn(String tag, String message, Throwable throwable); static void error(String message); static void error(String tag, String message); static void error(String message, Throwable throwable); static void error(String tag, String message, Throwable throwable); static final String HOCKEY_TAG; }
@Test public void sanitizeTagWorks() { String expected = HockeyLog.HOCKEY_TAG; String actual = HockeyLog.sanitizeTag(null); assertEquals(expected, actual); actual = HockeyLog.sanitizeTag(""); assertEquals(expected, actual); actual = HockeyLog.sanitizeTag("SomethingLongerThanTwentyThreeChars"); assertEquals(expected, actual); expected = "Exactly2ThreeCharacters"; actual = HockeyLog.sanitizeTag("Exactly2ThreeCharacters"); assertEquals(expected, actual); expected = "Awesome Hockey SDK"; actual = HockeyLog.sanitizeTag("Awesome Hockey SDK"); assertEquals(expected, actual); }