@@ -0,0 +1,2677 @@
+/*%0A * Copyright (c) 2014 Sebastian Paarmann%0A */%0Apackage paarmann.physikprofil;%0A%0Apublic final class Log %7B%0A%0A  /*%0A   * NOTE: I would have preferred to just subclass android.util.Log but%0A   * apparently this is not wanted. That class is declared final, so it%0A   * is not possible to extend it. Really don't know why. Would have been%0A   * a lot cleaner.%0A   */%0A%0A  public static final String APP_NAME = %22PhysikBioProfil%22;%0A%0A  private Log() %7B%0A  %7D%0A%0A  public static String formatTag(String tag) %7B%0A    return APP_NAME + %22, %22 + tag;%0A  %7D%0A%0A  public static String getStackTraceString(Throwable tr) %7B%0A    return android.util.Log.getStackTraceString(tr);%0A  %7D%0A%0A  public static int v(String tag, String msg) %7B%0A    return v(tag, msg, null);%0A  %7D%0A%0A  public static int v(String tag, String msg, Throwable tr) %7B%0A    return println(android.util.Log.VERBOSE,%0A        tag, msg, tr);%0A  %7D%0A%0A  public static int d(String tag, String msg) %7B%0A    return d(tag, msg, null);%0A  %7D%0A%0A  public static int d(String tag, String msg, Throwable tr) %7B%0A    return println(android.util.Log.DEBUG,%0A        tag, msg, tr);%0A  %7D%0A%0A  public static int i(String tag, String msg) %7B%0A    return i(tag, msg, null);%0A  %7D%0A%0A  public static int i(String tag, String msg, Throwable tr) %7B%0A    return println(android.util.Log.INFO,%0A        tag, msg, tr);%0A  %7D%0A%0A  public static int w(String tag, String msg) %7B%0A    return w(tag, msg, null);%0A  %7D%0A%0A  public static int w(String tag, Throwable tr) %7B%0A    return w(tag, %22%22, tr);%0A  %7D%0A%0A  public static int w(String tag, String msg, Throwable tr) %7B%0A    return println(android.util.Log.WARN,%0A        tag, msg, tr);%0A  %7D%0A%0A  public static int e(String tag, String msg) %7B%0A    return e(tag, msg, null);%0A  %7D%0A%0A  public static int e(String tag, String msg, Throwable tr) %7B%0A    return println(android.util.Log.ERROR,%0A        tag, msg, tr);%0A  %7D%0A%0A  public static int wtf(String tag, String msg) %7B%0A    return wtf(tag, msg, null);%0A  %7D%0A%0A  public static int wtf(String tag, Throwable tr) %7B%0A    return wtf(tag, %22%22, tr);%0A  %7D%0A%0A  public static int wtf(String tag, String msg, Throwable tr) %7B%0A    return println(android.util.Log.ASSERT,%0A        tag, msg, tr);%0A  %7D%0A%0A  public static int println(int priority, String tag, String msg) %7B%0A    return android.util.Log.println(priority, formatTag(tag), msg);%0A  %7D%0A%0A  public static int println(int priority, String tag, String msg, Throwable tr) %7B%0A    if (tr == null) %7B%0A      return println(priority, tag, msg);%0A    %7D%0A%0A    String stackTrace = getStackTraceString(tr);%0A    String%5B%5D stackLines = stackTrace.split(%22%5Cn%22);%0A%0A    int bytes = 0;%0A%0A    bytes += println(priority, tag, msg);%0A    for (String s : stackLines) %7B%0A      bytes += println(priority, tag, s);%0A    %7D%0A%0A    return bytes;%0A  %7D%0A%0A%7D%0A

Implement new logging system - See #24