public List<Record> handle(Record record) { List<Record> results = new ArrayList<>(); Object[] channels = record.channels(); for (int i = 0; i < channels.length; i++) { Object channel = channels[i]; if (oldChannelName.equals(channel)) { // make a new version of the Record with a different channel name channels[i] = newChannelName; Record reroutedRecord = new Record(record.content, channels, record.depth, record.timesstamp); results.add(reroutedRecord); return results; } } // didn't find any matching records, so just return the original one results.add(record); return results; } }
@Override public boolean matches(Record record) { for (Object tag : record.channels()) { if (tag.equals(matchingChannel)) { return true; } } return false; } }
@Override public boolean matches(Record record) { for (Object tag : record.channels()) { if (tag.equals(matchingChannel)) { return true; } } return false; } }
@Override public String toString() { return "Record [content=" + content + ", depth=" + depth + ", channels=" + Arrays.toString(channels()) + ", thread=" + thread + ", timesstamp=" + timesstamp + "]"; } }
@Override public String toString() { return "Record [content=" + content + ", depth=" + depth + ", channels=" + Arrays.toString(channels()) + ", thread=" + thread + ", timesstamp=" + timesstamp + "]"; } }
@Override public boolean matches(Redwood.Record message) { for (Object channel : message.channels()) { if (matchAgainst.contains(channel)) { return true; } } return false; } }), true),
@Override public boolean matches(Record record) { for (Object tag : record.channels()) { if (tag.equals(matchingChannel)) { return true; } } return false; } }
public List<Redwood.Record> handle(Redwood.Record record) { Pair<Logger, Redwood.Flag> loggerAndLevel = getLoggerAndLevel(record.channels());
private void flush(RepeatedRecordInfo info, List<Record> willReturn) { //(suppress all printing) if(info.suppressRecord){ return; } //(get time) int repeatedRecordCount = info.timesSeen - info.timesPrinted; if (repeatedRecordCount > 0) { //(send message record) //((add force tag)) Object[] newTags = new Object[info.lastRecord.channels().length+1]; System.arraycopy(info.lastRecord.channels(),0,newTags,1,info.lastRecord.channels().length); newTags[0] = Redwood.FORCE; //((create record)) Record newRecord = new Record( repeatSemantics.message(repeatedRecordCount), newTags, info.lastRecord.depth, info.lastRecord.timesstamp); //((pass record)) willReturn.add(newRecord); info.timesSeen = 0; info.timesPrinted = 0; } }
@Override public String toString() { return "Record [content=" + content + ", depth=" + depth + ", channels=" + Arrays.toString(channels()) + ", thread=" + thread + ", timesstamp=" + timesstamp + ']'; } }
@Override public boolean matches(Redwood.Record message) { for (Object channel : message.channels()) { if (matchAgainst.contains(channel)) { return true; } } return false; } }), true),