@@ -0,0 +1,2688 @@
+// Copyright 2014, Kevin Ko %3Ckevin@faveset.com%3E%0A%0Apackage com.faveset.log;%0A%0Aimport java.io.OutputStream;%0Aimport java.io.PrintWriter;%0A%0Apublic class OutputStreamLog implements Log %7B%0A    private static final String sDebugLabel = %22DEBUG%22;%0A    private static final String sErrorLabel = %22ERROR%22;%0A    private static final String sInfoLabel = %22INFO%22;%0A    private static final String sVerboseLabel = %22VERBOSE%22;%0A    private static final String sWarnLabel = %22WARN%22;%0A%0A    private PrintWriter mWriter;%0A%0A    public OutputStreamLog(OutputStream os) %7B%0A        mWriter = new PrintWriter(os);%0A    %7D%0A%0A    public synchronized int d(String tag, String msg) %7B%0A        mWriter.append(makeString(sDebugLabel, tag, msg));%0A    %7D%0A%0A    public synchronized int d(String tag, String msg, Throwable tr) %7B%0A        mWriter.append(makeExceptionString(sDebugLabel, tag, msg, tr));%0A    %7D%0A%0A    public synchronized int e(String tag, String msg) %7B%0A        mWriter.append(makeString(sErrorLabel, tag, msg));%0A    %7D%0A%0A    public synchronized int e(String tag, String msg, Throwable tr) %7B%0A        mWriter.append(makeExceptionString(sErrorLabel, tag, msg, tr));%0A    %7D%0A%0A    public synchronized int i(String tag, String msg) %7B%0A        mWriter.append(makeString(sInfoLabel, tag, msg));%0A    %7D%0A%0A    public synchronized int i(String tag, String msg, Throwable tr) %7B%0A        mWriter.append(makeExceptionString(sInfoLabel, tag, msg, tr));%0A    %7D%0A%0A    public synchronized int v(String tag, String msg) %7B%0A        mWriter.append(makeString(sVerboseLabel, tag, msg));%0A    %7D%0A%0A    public synchronized int v(String tag, String msg, Throwable tr) %7B%0A        mWriter.append(makeExceptionString(sVerboseLabel, tag, msg, tr));%0A    %7D%0A%0A    public synchronized int w(String tag, String msg) %7B%0A        mWriter.append(makeString(sWarnLabel, tag, msg));%0A    %7D%0A%0A    public synchronized int w(String tag, String msg, Throwable tr) %7B%0A        mWriter.append(makeExceptionString(sWarnLabel, tag, msg, tr));%0A    %7D%0A%0A    private static String makeString(String label, String tag, String msg) %7B%0A        StringBuilder builder = new StringBuilder();%0A        builder.append(label);%0A        builder.append(%22: %22);%0A        builder.append(tag);%0A        builder.append(%22: %22);%0A        builder.append(msg);%0A        return builder.toString();%0A    %7D%0A%0A    private static String makeExceptionString(String label, String tag, String msg, Throwable tr) %7B%0A        StringBuilder builder = new StringBuilder();%0A        builder.append(label);%0A        builder.append(%22: %22);%0A        builder.append(tag);%0A        builder.append(%22: caught exception %22);%0A        builder.append(tr.toString());%0A        builder.append(%22: %22);%0A        builder.append(msg);%0A        return builder.toString();%0A    %7D%0A%7D%0A

Add simple logging abstraction.