Example usage for android.util Log DEBUG

List of usage examples for android.util Log DEBUG

Introduction

In this page you can find the example usage for android.util Log DEBUG.

Prototype

int DEBUG

To view the source code for android.util Log DEBUG.

Click Source Link

Document

Priority constant for the println method; use Log.d.

Usage

From source file:Main.java

public static void LOGD(final String tag, String message) {
    if (LOGGING_ENABLED) {
        if (Log.isLoggable(tag, Log.DEBUG)) {
            Log.d(tag, message);//  w ww  .j  a  v a2 s  .  c  o m
        }
    }
}

From source file:Main.java

public static void LOGD(final String tag, String message, Throwable cause) {
    if (LOGGING_ENABLED) {
        if (Log.isLoggable(tag, Log.DEBUG)) {
            Log.d(tag, message, cause);//from w w w. j a  v a 2 s. co m
        }
    }
}

From source file:Main.java

/**
 * debug log//from ww w . j  a v a  2s . c  o  m
 * @param tag tag
 * @param msg log msg
 */
public static void d(String tag, String msg) {
    if (LOG_ENABLE && Log.isLoggable(tag, Log.DEBUG)) {
        Log.d(tag, buildMsg(msg));
    }
}

From source file:Main.java

/**
 * @param message     Message to display
 * @param type        [Log.Error, Log.Warn, ...]
 * @param shouldPrint value that comes from Preferences which allows the user to decide if debug info should be printed to logcat. Error info will ALWAYS be displayed despite this value
 *///from  w w  w  .  java 2s .c om
public static void debugFunc(String message, int type, boolean shouldPrint) {
    // errors must always be displayed
    if (type == Log.ERROR) {
        Log.e(LOG_TAG, message);
    } else if (shouldPrint) {
        switch (type) {
        case Log.DEBUG:
            Log.d(LOG_TAG, message);
            break;
        case Log.INFO:
            Log.i(LOG_TAG, message);
            break;
        case Log.VERBOSE:
            Log.v(LOG_TAG, message);
            break;
        case Log.WARN:
            Log.w(LOG_TAG, message);
            break;
        default:
            Log.v(LOG_TAG, message);
            break;
        }
    }
}

From source file:Main.java

private static void log(String tag, int level, String msg, Throwable tr) {
    if (isLog) {/*from  w w  w.  j ava 2s.c o m*/
        switch (level) {
        case Log.VERBOSE:
            if (tr == null) {
                Log.v(tag, msg);
            } else {
                Log.v(tag, msg, tr);
            }
            break;
        case Log.INFO:
            if (tr == null) {
                Log.i(tag, msg);
            } else {
                Log.i(tag, msg, tr);
            }
            break;
        case Log.DEBUG:
            if (tr == null) {
                Log.d(tag, msg);
            } else {
                Log.d(tag, msg, tr);
            }
            break;
        case Log.WARN:
            if (tr == null) {
                Log.w(tag, msg);
            } else {
                Log.w(tag, msg, tr);
            }
            break;
        case Log.ERROR:
            if (tr == null) {
                Log.e(tag, msg, tr);
            } else {
                Log.e(tag, msg, tr);
            }
            break;
        }
    }
}

From source file:Main.java

public static int d(String tag, String msg) {
    return println(Log.DEBUG, tag, msg);
}

From source file:Main.java

/**
 * A simple wrapper around LOGD//w  w w .  j  a v  a2 s .  co  m
 */
public static final void LOGD(String TAG, String message) {
    if (Log.isLoggable(TAG, Log.DEBUG)) {
        Log.d(TAG, message);
    }
}

From source file:Main.java

public static void LOGD(final String tag, String message) {
    //noinspection PointlessBooleanExpression,ConstantConditions
    if (debug || Log.isLoggable(tag, Log.DEBUG)) {
        Log.d(tag, message);/*from w  w w.  j  a v  a 2s. co  m*/
    }
}

From source file:Main.java

public static int d(String tag, String msg, Throwable tr) {
    return println(Log.DEBUG, tag, msg + '\n' + getStackTraceString(tr));
}

From source file:Main.java

/**
 * Logs provided logText with "TGF" tag and android.util.Log.DEBUG log level
 * @param logText String//from   www  . j a va2 s.  c  om
 */
public static void log(String logText) {
    log(Log.DEBUG, LOG_TAG, logText);
}