use of org.osgi.service.log.LogEntry in project vespa by vespa-engine.
the class ConsoleLogFormatterTestCase method requireThatMessageIsIncluded.
@Test
public void requireThatMessageIsIncluded() {
LogEntry entry = new MyEntry(0, 0, "message");
assertEquals("0.000\t-\t-\t-\t-\tunknown\tmessage", SIMPLE_FORMATTER.formatEntry(entry));
}
use of org.osgi.service.log.LogEntry in project vespa by vespa-engine.
the class ConsoleLogFormatterTestCase method requireThatExceptionIsSimplifiedForInfoEntries.
@Test
public void requireThatExceptionIsSimplifiedForInfoEntries() {
Throwable t = new Throwable("exception");
LogEntry entry = new MyEntry(0, LogService.LOG_INFO, "entry").setException(t);
assertEquals("0.000\t-\t-\t-\t-\tinfo\tentry: exception", SIMPLE_FORMATTER.formatEntry(entry));
}
use of org.osgi.service.log.LogEntry in project vespa by vespa-engine.
the class ConsoleLogFormatterTestCase method requireThatExceptionIsIncluded.
@Test
public void requireThatExceptionIsIncluded() {
Throwable t = new Throwable();
LogEntry entry = new MyEntry(0, 0, null).setException(t);
assertEquals("0.000\t-\t-\t-\t-\tunknown\t\\n" + formatThrowable(t), SIMPLE_FORMATTER.formatEntry(entry));
}
use of org.osgi.service.log.LogEntry in project vespa by vespa-engine.
the class ConsoleLogFormatterTestCase method requireThatSimplifiedExceptionMessageIsOptional.
@Test
public void requireThatSimplifiedExceptionMessageIsOptional() {
Throwable t = new Throwable();
LogEntry entry = new MyEntry(0, LogService.LOG_INFO, "entry").setException(t);
assertEquals("0.000\t-\t-\t-\t-\tinfo\tentry: java.lang.Throwable", SIMPLE_FORMATTER.formatEntry(entry));
}
use of org.osgi.service.log.LogEntry in project vespa by vespa-engine.
the class ConsoleLogFormatterTestCase method requireThatMillisecondsArePadded.
// TODO: Should (at least) use ConsoleLogFormatter.ABSENCE_REPLACEMENT instead of literal '-'. See ticket 7128315.
@Test
public void requireThatMillisecondsArePadded() {
for (int i = 0; i < 10000; ++i) {
LogEntry entry = new MyEntry(i, 0, null);
assertEquals(String.format("%d.%03d\t-\t-\t-\t-\tunknown\t", i / 1000, i % 1000), SIMPLE_FORMATTER.formatEntry(entry));
}
}
Aggregations