use of org.osgi.service.log.LogEntry in project vespa by vespa-engine.
the class ConsoleLogFormatterTestCase method requireThatSimplifiedExceptionIsEscaped.
@Test
public void requireThatSimplifiedExceptionIsEscaped() {
Throwable t = new Throwable("\\\n\r\t");
LogEntry entry = new MyEntry(0, LogService.LOG_INFO, "entry").setException(t);
assertEquals("0.000\t-\t-\t-\t-\tinfo\tentry: \\\\\\n\\r\\t", SIMPLE_FORMATTER.formatEntry(entry));
}
use of org.osgi.service.log.LogEntry in project vespa by vespa-engine.
the class ConsoleLogFormatterTestCase method requireThatMessageIsEscaped.
@Test
public void requireThatMessageIsEscaped() {
LogEntry entry = new MyEntry(0, 0, "\\\n\r\t");
assertEquals("0.000\t-\t-\t-\t-\tunknown\t\\\\\\n\\r\\t", SIMPLE_FORMATTER.formatEntry(entry));
}
use of org.osgi.service.log.LogEntry in project vespa by vespa-engine.
the class ConsoleLogFormatterTestCase method requireThatProcessIdIncludesThreadIdWhenAvailable.
@Test
public void requireThatProcessIdIncludesThreadIdWhenAvailable() {
LogEntry entry = new MyEntry(0, 0, null).putProperty("THREAD_ID", "threadId");
assertEquals("0.000\t-\tprocessId/threadId\t-\t-\tunknown\t", new ConsoleLogFormatter(null, "processId", null).formatEntry(entry));
}
use of org.osgi.service.log.LogEntry in project vespa by vespa-engine.
the class ConsoleLogFormatterTestCase method requireThatLoggerNameIsIncluded.
@Test
public void requireThatLoggerNameIsIncluded() {
LogEntry entry = new MyEntry(0, 0, null).putProperty("LOGGER_NAME", "loggerName");
assertEquals("0.000\t-\t-\t-\t/loggerName\tunknown\t", SIMPLE_FORMATTER.formatEntry(entry));
}
use of org.osgi.service.log.LogEntry in project vespa by vespa-engine.
the class ConsoleLogFormatterTestCase method requireThatExceptionIsEscaped.
@Test
public void requireThatExceptionIsEscaped() {
Throwable t = new Throwable("\\\n\r\t");
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));
}
Aggregations