Android Open Source - DroidSweeper Log Dog






From Project

Back to project page DroidSweeper.

License

The source code is released under:

MIT License

If you think the Android project DroidSweeper listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package de.nisble.droidsweeper.utilities;
/*from   w w  w .  jav  a  2s .  c o m*/
import de.nisble.droidsweeper.BuildConfig;
import android.util.Log;

/** LogDog: The natural enemy of LogCat.
 * <p>
 * <b>Note:</b> Use the following ProGuard statement to completely remove all
 * calls to Log:
 *
 * <pre>
 * -assumenosideeffects class android.util.Log {
 *     public static *** v(...);
 *     public static *** d(...);
 *     public static *** i(...);
 *     public static *** w(...);
 * }
 * </pre>
 *
 * </p>
 * @author Moritz Nisbl moritz.nisble@gmx.de */
public final class LogDog {
  // private static final String CLASSNAME = LogDog.class.getSimpleName();

  // public static void check() {
  // Log.println(Log.ASSERT, CLASSNAME, "BuildConfig.DEBUG=" +
  // BuildConfig.DEBUG);
  // Log.println(Log.ASSERT, CLASSNAME, "Log.isLoggable(..., Log.VERBOSE)=" +
  // Log.isLoggable(CLASSNAME, Log.VERBOSE));
  // Log.println(Log.ASSERT, CLASSNAME, "Log.isLoggable(..., Log.DEBUG)=" +
  // Log.isLoggable(CLASSNAME, Log.DEBUG));
  // Log.println(Log.ASSERT, CLASSNAME, "Log.isLoggable(..., Log.INFO)=" +
  // Log.isLoggable(CLASSNAME, Log.INFO));
  // Log.println(Log.ASSERT, CLASSNAME, "Log.isLoggable(..., Log.WARN)=" +
  // Log.isLoggable(CLASSNAME, Log.WARN));
  // Log.println(Log.ASSERT, CLASSNAME, "Log.isLoggable(..., Log.ERROR)=" +
  // Log.isLoggable(CLASSNAME, Log.ERROR));
  // }

  /** Send an {@link Log#VERBOSE} log message.
   * @param tag Used to identify the source of a log message. It usually
   *            identifies
   *            the class or activity where the log call occurs.
   * @param msg The message you would like logged. */
  public static void v(String tag, String msg) {
    // Removed from release when BuildConfig.DEBUG is false.
    if (BuildConfig.DEBUG && Log.isLoggable(tag, Log.VERBOSE)) {
      Log.v(tag, msg);
    }
  }

  /** Send an {@link Log#VERBOSE} log message and log the exception.
   * @param tag Used to identify the source of a log message. It usually
   *            identifies
   *            the class or activity where the log call occurs.
   * @param msg The message you would like logged. */
  public static void v(String tag, String msg, Throwable tr) {
    // Removed from release when BuildConfig.DEBUG is false.
    if (BuildConfig.DEBUG && Log.isLoggable(tag, Log.VERBOSE)) {
      Log.v(tag, msg, tr);
    }
  }

  /** Send an {@link Log#DEBUG} log message.
   * @param tag Used to identify the source of a log message. It usually
   *            identifies
   *            the class or activity where the log call occurs.
   * @param msg The message you would like logged. */
  public static void d(String tag, String msg) {
    // Removed from release when BuildConfig.DEBUG is false.
    if (BuildConfig.DEBUG && Log.isLoggable(tag, Log.DEBUG)) {
      Log.d(tag, msg);
    }
  }

  /** Send an {@link Log#DEBUG} log message and log the exception.
   * @param tag Used to identify the source of a log message. It usually
   *            identifies
   *            the class or activity where the log call occurs.
   * @param msg The message you would like logged. */
  public static void d(String tag, String msg, Throwable tr) {
    // Removed from release when BuildConfig.DEBUG is false.
    if (BuildConfig.DEBUG && Log.isLoggable(tag, Log.DEBUG)) {
      Log.d(tag, msg, tr);
    }
  }

  /** Send an {@link Log#INFO} log message.
   * @param tag Used to identify the source of a log message. It usually
   *            identifies
   *            the class or activity where the log call occurs.
   * @param msg The message you would like logged. */
  public static void i(String tag, String msg) {
    if (Log.isLoggable(tag, Log.INFO)) {
      Log.i(tag, msg);
    }
  }

  /** Send an {@link Log#INFO} log message and log the exception.
   * @param tag Used to identify the source of a log message. It usually
   *            identifies
   *            the class or activity where the log call occurs.
   * @param msg The message you would like logged. */
  public static void i(String tag, String msg, Throwable tr) {
    if (Log.isLoggable(tag, Log.INFO)) {
      Log.i(tag, msg, tr);
    }
  }

  /** Send an {@link Log#WARN} log message.
   * @param tag Used to identify the source of a log message. It usually
   *            identifies
   *            the class or activity where the log call occurs.
   * @param msg The message you would like logged. */
  public static void w(String tag, String msg) {
    if (Log.isLoggable(tag, Log.WARN)) {
      Log.w(tag, msg);
    }
  }

  /** Send an {@link Log#WARN} log message and log the exception.
   * @param tag Used to identify the source of a log message. It usually
   *            identifies
   *            the class or activity where the log call occurs.
   * @param msg The message you would like logged. */
  public static void w(String tag, String msg, Throwable tr) {
    if (Log.isLoggable(tag, Log.WARN)) {
      Log.w(tag, msg, tr);
    }
  }

  /** Send an {@link Log#ERROR} log message.
   * @param tag Used to identify the source of a log message. It usually
   *            identifies
   *            the class or activity where the log call occurs.
   * @param msg The message you would like logged. */
  public static void e(String tag, String msg) {
    if (Log.isLoggable(tag, Log.ERROR)) {
      Log.e(tag, msg);
    }
  }

  /** Send an {@link Log#ERROR} log message and log the exception.
   * @param tag Used to identify the source of a log message. It usually
   *            identifies
   *            the class or activity where the log call occurs.
   * @param msg The message you would like logged. */
  public static void e(String tag, String msg, Throwable tr) {
    if (Log.isLoggable(tag, Log.ERROR)) {
      Log.e(tag, msg, tr);
    }
  }
}




Java Source Code List

de.nisble.droidsweeper.config.ApplicationConfig.java
de.nisble.droidsweeper.config.Constants.java
de.nisble.droidsweeper.config.GameConfig.java
de.nisble.droidsweeper.config.Level.java
de.nisble.droidsweeper.game.Field.java
de.nisble.droidsweeper.game.GameObserver.java
de.nisble.droidsweeper.game.Game.java
de.nisble.droidsweeper.game.Position.java
de.nisble.droidsweeper.game.database.DSDBAdapter.java
de.nisble.droidsweeper.game.database.DSDBContract.java
de.nisble.droidsweeper.game.database.DSDBGameEntry.java
de.nisble.droidsweeper.game.database.DSDBHelper.java
de.nisble.droidsweeper.game.jni.FieldListener.java
de.nisble.droidsweeper.game.jni.FieldStatus.java
de.nisble.droidsweeper.game.jni.GameStatus.java
de.nisble.droidsweeper.game.jni.MatrixObserver.java
de.nisble.droidsweeper.game.jni.MineSweeperMatrix.java
de.nisble.droidsweeper.game.replay.PlayerObserver.java
de.nisble.droidsweeper.game.replay.Player.java
de.nisble.droidsweeper.game.replay.Recorder.java
de.nisble.droidsweeper.game.replay.Replay.java
de.nisble.droidsweeper.game.replay.TimeStep.java
de.nisble.droidsweeper.gui.DroidSweeperActivity.java
de.nisble.droidsweeper.gui.HighScoreActivity.java
de.nisble.droidsweeper.gui.HighScoreListAdapter.java
de.nisble.droidsweeper.gui.SettingsActivity.java
de.nisble.droidsweeper.gui.grid.FieldDrawables.java
de.nisble.droidsweeper.gui.grid.FieldView.java
de.nisble.droidsweeper.gui.grid.GameGridView.java
de.nisble.droidsweeper.utilities.LogDog.java
de.nisble.droidsweeper.utilities.Timer.java