Search in sources :

Example 1 with SafeArg

use of com.palantir.logsafe.SafeArg in project atlasdb by palantir.

the class TokenRangeWritesLoggerTest method assertLoggedNotUniform.

@SuppressWarnings("unchecked")
private void assertLoggedNotUniform(long fst, long snd, long trd, long fth, TableReference tableRef) {
    LoggingEvent loggingEvent = getLoggingEventAndAssertLoggedAtLevel(Level.WARN);
    Assert.assertThat(loggingEvent.getArguments().get(0), Matchers.equalTo(LoggingArgs.tableRef(tableRef)));
    SafeArg<List<String>> argument = (SafeArg<List<String>>) loggingEvent.getArguments().get(1);
    Assert.assertThat(argument.getValue(), Matchers.containsInAnyOrder("range from (no lower bound) to 626364 has " + fst + " writes", "range from 626364 to 676869 has " + snd + " writes", "range from 676869 to 6F7071 has " + trd + " writes", "range from 6F7071 to (no upper bound) has " + fth + " writes"));
}
Also used : LoggingEvent(uk.org.lidalia.slf4jtest.LoggingEvent) List(java.util.List) SafeArg(com.palantir.logsafe.SafeArg)

Aggregations

SafeArg (com.palantir.logsafe.SafeArg)1 List (java.util.List)1 LoggingEvent (uk.org.lidalia.slf4jtest.LoggingEvent)1