Wed, 31 Dec 2014 07:22:50 +0100
Correct previous dual key logic pending first delivery installment.
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 package org.mozilla.gecko.background.common.log.writers;
7 import java.io.PrintWriter;
8 import java.io.StringWriter;
10 public class StringLogWriter extends LogWriter {
11 protected final StringWriter sw;
12 protected final PrintLogWriter inner;
14 public StringLogWriter() {
15 sw = new StringWriter();
16 inner = new PrintLogWriter(new PrintWriter(sw));
17 }
19 public String toString() {
20 return sw.toString();
21 }
23 @Override
24 public boolean shouldLogVerbose(String tag) {
25 return true;
26 }
28 public void error(String tag, String message, Throwable error) {
29 inner.error(tag, message, error);
30 }
32 public void warn(String tag, String message, Throwable error) {
33 inner.warn(tag, message, error);
34 }
36 public void info(String tag, String message, Throwable error) {
37 inner.info(tag, message, error);
38 }
40 public void debug(String tag, String message, Throwable error) {
41 inner.debug(tag, message, error);
42 }
44 public void trace(String tag, String message, Throwable error) {
45 inner.trace(tag, message, error);
46 }
48 public void close() {
49 inner.close();
50 }
51 }