Skip to content

Instantly share code, notes, and snippets.

@detro
Created April 4, 2014 17:39
Show Gist options
  • Save detro/9979394 to your computer and use it in GitHub Desktop.
Save detro/9979394 to your computer and use it in GitHub Desktop.
private LogEntries getRemoteEntries(String logType) {
Object raw = executeMethod.execute(DriverCommand.GET_LOG, ImmutableMap.of(TYPE_KEY, logType));
@SuppressWarnings("unchecked")
List<Map<String, Object>> rawList = (List<Map<String, Object>>) raw;
List<LogEntry> remoteEntries = Lists.newArrayListWithCapacity(rawList.size());
for (Map<String, Object> obj : rawList) {
remoteEntries.add(new LogEntry(LogLevelMapping.toLevel((String)obj.get(LEVEL)),
(Long) obj.get(TIMESTAMP),
(String) obj.get(MESSAGE)));
}
return new LogEntries(remoteEntries);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment