use of com.yahoo.logserver.formatter.LogFormatter in project vespa by vespa-engine.
the class ReplicatorConnection method onListFormatters.
void onListFormatters() {
print("# 206 formatter list\n");
String[] formatterNames = LogFormatterManager.getFormatterNames();
for (int i = 0; i < formatterNames.length; i++) {
LogFormatter fmt = LogFormatterManager.getLogFormatter(formatterNames[i]);
print("# 207 " + formatterNames[i] + " - " + fmt.description() + "\n");
}
print("# 208 end formatter list\n");
}
use of com.yahoo.logserver.formatter.LogFormatter in project vespa by vespa-engine.
the class ReplicatorConnection method onFormatter.
void onFormatter(String formatterName) {
LogFormatter newFormatter = LogFormatterManager.getLogFormatter(formatterName);
if (newFormatter == null) {
print("# 405 formatter not found '" + formatterName + "'\n");
return;
}
formatter = newFormatter;
this.formatterName = formatterName;
print("# 202 using '" + formatter + "'\n");
}
use of com.yahoo.logserver.formatter.LogFormatter in project vespa by vespa-engine.
the class LogFormatterManagerTestCase method testSystemFormatters.
/**
* Ensure the system formatters are present
*/
@Test
public void testSystemFormatters() {
LogFormatter lf = LogFormatterManager.getLogFormatter("system.textformatter");
assertNotNull(lf);
assertEquals(TextFormatter.class, lf.getClass());
lf = LogFormatterManager.getLogFormatter("system.nullformatter");
assertNotNull(lf);
assertEquals(NullFormatter.class, lf.getClass());
}
use of com.yahoo.logserver.formatter.LogFormatter in project vespa by vespa-engine.
the class FormattedBufferCacheTestCase method testCache.
@Test
public void testCache() {
LogMessage[] msgs = MockLogEntries.getMessages();
FormattedBufferCache cache = new FormattedBufferCache();
String[] n = LogFormatterManager.getFormatterNames();
for (int i = 0; i < n.length; i++) {
LogFormatter f = LogFormatterManager.getLogFormatter(n[i]);
for (int j = 0; j < msgs.length; j++) {
ByteBuffer bb = cache.getFormatted(msgs[j], f);
assertNotNull(bb);
}
}
assertTrue(cache.getUnderlyingMapOnlyForTesting().size() > 0);
cache.reset();
assertTrue(cache.getUnderlyingMapOnlyForTesting().size() == 0);
}
Aggregations