class CompactFormatter implements LogEventFormatter {

    @Override
    public String format(Timber.LogEvent logEvent) {
        StringBuilder buff = new StringBuilder(200);
        Util.formatTimeISO(logEvent.getTimestamp(), buff);

        buff.append('\t')
            .append(logEvent.getHost())
            .append('\t')

            // Add service name
            .append(logEvent.getServiceName())
            .append('\t')

            // Add source
            .append(classFromSource(logEvent.getSource()))
            .append('\t')

            // Type of log message
            .append(logEvent.getType())
            .append('\t')

            // Level of log message
            .append(Util.logLevelNameForValue(logEvent.getLevel()))
            .append('\t')

            // Add consistency level
            .append(logEvent.getConsistencyLevel().toString().substring(0,2))
            .append('\t');

        // Add the payloads
        boolean first = true;
        for (Timber.Payload payload : logEvent.getPayloadList()) {
            String s = payload.getPayload().toStringUtf8();

            // Truncate exceptions
            if ("application/java-exception".equals(payload.getContentType())) {
                int offset = s.indexOf('\n');
                if (offset > 0) {
                    s = s.substring(0, offset);
                }
            }

            buff.append((first?"":" | "))
                .append(payload.getName())
                .append(": ")
                .append(Util.escape(s));

            first = false;
        }

        return buff.toString();
    }

}