@Test public void longTagAllowedIfNotCheckLoggable() { LoggingEvent event = new LoggingEvent(); event.setMessage(TAG); boolean checkLoggable = false; setTagPattern(TAG, checkLoggable); String actualTag = logcatAppender.getTag(event); assertThat(TRUNCATED_TAG, is(not(actualTag))); assertThat(TAG, is(actualTag)); }
protected String getTag(ILoggingEvent event) { String tag = (this.tagEncoder != null) ? this.tagEncoder.getLayout().doLayout(event) : event.getLoggerName(); if (checkLoggable && (tag.length() > MAX_TAG_LENGTH)) { tag = tag.substring(0, MAX_TAG_LENGTH - 1) + "*"; } return tag; }
LogcatAppender extends UnsynchronizedAppenderBase<ILoggingEvent> { protected String getTag(ILoggingEvent event) { String tag = (this.tagEncoder != null) ? this.tagEncoder.getLayout().doLayout(event) : event.getLoggerName(); if (checkLoggable && (tag.length() > MAX_TAG_LENGTH)) { tag = tag.substring(0, MAX_TAG_LENGTH - 1) + "*"; } return tag; } }
LogcatAppender extends UnsynchronizedAppenderBase<ILoggingEvent> { protected String getTag(ILoggingEvent event) { String tag = (this.tagEncoder != null) ? this.tagEncoder.getLayout().doLayout(event) : event.getLoggerName(); if (checkLoggable && (tag.length() > MAX_TAG_LENGTH)) { tag = tag.substring(0, MAX_TAG_LENGTH - 1) + "*"; } return tag; } LogcatAppender(); }
LogcatAppender extends UnsynchronizedAppenderBase<ILoggingEvent> { protected String getTag(ILoggingEvent event) { String tag = (this.tagEncoder != null) ? this.tagEncoder.getLayout().doLayout(event) : event.getLoggerName(); if (checkLoggable && (tag.length() > MAX_TAG_LENGTH)) { tag = tag.substring(0, MAX_TAG_LENGTH - 1) + "*"; } return tag; } LogcatAppender(); @Override void start(); void append(ILoggingEvent event); PatternLayoutEncoder getEncoder(); void setEncoder(PatternLayoutEncoder encoder); PatternLayoutEncoder getTagEncoder(); void setTagEncoder(PatternLayoutEncoder encoder); void setCheckLoggable(boolean enable); boolean getCheckLoggable(); }
LogcatAppender extends UnsynchronizedAppenderBase<ILoggingEvent> { protected String getTag(ILoggingEvent event) { String tag = (this.tagEncoder != null) ? this.tagEncoder.getLayout().doLayout(event) : event.getLoggerName(); if (checkLoggable && (tag.length() > MAX_TAG_LENGTH)) { tag = tag.substring(0, MAX_TAG_LENGTH - 1) + "*"; } return tag; } LogcatAppender(); @Override void start(); void append(ILoggingEvent event); PatternLayoutEncoder getEncoder(); void setEncoder(PatternLayoutEncoder encoder); PatternLayoutEncoder getTagEncoder(); void setTagEncoder(PatternLayoutEncoder encoder); void setCheckLoggable(boolean enable); boolean getCheckLoggable();  }