01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: SwallowingLogFormatter.java 3634 2007-01-08 21:42:24Z gbevin $
07: */
08: package com.uwyn.rife.tools;
09:
10: import java.util.ArrayList;
11: import java.util.List;
12: import java.util.logging.Formatter;
13: import java.util.logging.LogRecord;
14:
15: public class SwallowingLogFormatter extends Formatter {
16: private ArrayList<LogRecord> mRecords = new ArrayList<LogRecord>();
17:
18: /**
19: * Format the given LogRecord.
20: * @param record the log record to be formatted.
21: * @return a formatted log record
22: */
23: public String format(LogRecord record) {
24: mRecords.add(record);
25: return "";
26: }
27:
28: public List<LogRecord> getRecords() {
29: return mRecords;
30: }
31: }
|