Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 694d29e8 authored by Oscar Azucena's avatar Oscar Azucena
Browse files

Added new dump method with indent for LocalLog.

Added new dump method with indent parameter to add extra string indent
to the dump output.

Bug: 139097051
Test: build and ran app with/without indent.
Change-Id: Ie4973e75fd4c29505c8f8b5601da9236ebbf9943
parent 336f7c75
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -60,9 +60,19 @@ public final class LocalLog {
    }

    public synchronized void dump(PrintWriter pw) {
        dump("", pw);
    }

    /**
     * Dumps the content of local log to print writer with each log entry predeced with indent
     *
     * @param indent indent that precedes each log entry
     * @param pw printer writer to write into
     */
    public synchronized void dump(String indent, PrintWriter pw) {
        Iterator<String> itr = mLog.iterator();
        while (itr.hasNext()) {
            pw.println(itr.next());
            pw.printf("%s%s\n", indent, itr.next());
        }
    }