| | |
| | | public List<Message> getLogMessages() { |
| | | List<Message> formattedLogs = new ArrayList<Message>(); |
| | | for (String aLog : logs) { |
| | | formattedLogs.add(Message.raw(formatLogMessage(aLog))); |
| | | formattedLogs.add(Message.raw(aLog)); |
| | | } |
| | | return Collections.unmodifiableList(formattedLogs); |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * Formats a log message for appending to the table. |
| | | * @param msg to format |
| | | * @return formatted message |
| | | */ |
| | | private String formatLogMessage(String msg) { |
| | | // Use this to prepend to log messages. Since they |
| | | // are long and usually wrap, without this it is |
| | | // difficult to tell where one stops and another starts |
| | | StringBuffer sb = new StringBuffer(); |
| | | sb.append("\u2022"); |
| | | sb.append(" "); |
| | | sb.append(msg); |
| | | return sb.toString(); |
| | | } |
| | | |
| | | /** |
| | | * Formats a time string into a human friendly format. |
| | | * @param timeString the is human hostile |
| | | * @return string of time that is human friendly |