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, Throwable cause) {
    //noinspection PointlessBooleanExpression,ConstantConditions
    if (debug || Log.isLoggable(tag, Log.DEBUG)) {
        Log.d(tag, message, cause);//from   ww w  . jav a2s  .  c om
    }
}

From source file:Main.java

/**
 * Logs provided logText in provided tag with android.util.Log.DEBUG log level
 * @param tag String/*from w ww  . j  a  va 2 s .c o  m*/
 * @param logText String
 */
public static void log(String tag, String logText) {
    log(Log.DEBUG, tag, logText);
}

From source file:Main.java

private static void print(int mode, final String tag, String msg) {
    if (!isPrint) {
        return;//from ww w  .j  a  v  a2s.c o  m
    }
    if (msg == null) {
        Log.e(tag, MSG);
        return;
    }
    switch (mode) {
    case Log.VERBOSE:
        Log.v(tag, msg);
        break;
    case Log.DEBUG:
        Log.d(tag, msg);
        break;
    case Log.INFO:
        Log.i(tag, msg);
        break;
    case Log.WARN:
        Log.w(tag, msg);
        break;
    case Log.ERROR:
        Log.e(tag, msg);
        break;
    default:
        Log.d(tag, msg);
        break;
    }
}

From source file:com.android.utils.PerformActionUtils.java

private static void logPerformAction(AccessibilityNodeInfoCompat node, int action) {
    LogUtils.log(PerformActionUtils.class, Log.DEBUG,
            "perform action " + action + " for node " + node.toString());
}

From source file:Main.java

/**
 * Logs provided logText in provided tag at given logLevel (like, android.util.Log.DEBUG)
 * @param logLevel int VERBOSE, DEBUG, INFO, WARN, ERROR
 * @param tag String//from w  w w  .  j a  v  a2  s.com
 * @param logText String
 */
public static void log(int logLevel, String tag, String logText) {
    switch (logLevel) {
    case Log.VERBOSE:
        Log.v(tag, logText);
        break;

    case Log.DEBUG:
        Log.d(tag, logText);
        break;

    case Log.INFO:
        Log.i(tag, logText);
        break;

    case Log.WARN:
        Log.w(tag, logText);
        break;

    case Log.ERROR:
        Log.e(tag, logText);
        break;
    }
}

From source file:Main.java

public static void d(String tag, String msg) {
    print(Log.DEBUG, tag, msg);
    print(isDebug, msg);
}

From source file:com.joptimizer.solvers.DiagonalKKTSolver.java

/**
 * Returns two vectors v and w.//  w  ww .j  av  a  2 s. c o  m
 */
@Override
public double[][] solve() throws Exception {

    RealVector v = null;
    RealVector w = null;

    if (Log.isLoggable(MainActivity.JOPTIMIZER_LOGTAG, Log.DEBUG)) {
        Log.d(MainActivity.JOPTIMIZER_LOGTAG, "H: " + ArrayUtils.toString(H.getData()));
        Log.d(MainActivity.JOPTIMIZER_LOGTAG, "g: " + ArrayUtils.toString(g.toArray()));
    }

    v = new ArrayRealVector(g.getDimension());
    for (int i = 0; i < v.getDimension(); i++) {
        v.setEntry(i, -g.getEntry(i) / H.getEntry(i, i));
    }

    // solution checking
    if (this.checkKKTSolutionAccuracy && !this.checkKKTSolutionAccuracy(v, w)) {
        Log.e(MainActivity.JOPTIMIZER_LOGTAG, "KKT solution failed");
        throw new Exception("KKT solution failed");
    }

    double[][] ret = new double[2][];
    ret[0] = v.toArray();
    ret[1] = (w != null) ? w.toArray() : null;
    return ret;
}

From source file:org.tritsch.android.chargefinder.CFService.java

/**
 * <code>lockup<code> will contact the chargefinder service and will retrieve
 * a/the list of stations described by the parameters.
 *
 * @param pointX - x coordinates to start the search from
 * @param pointY - y coordinates to start the search from
 * @param radius - the radius from x, y to include in the search
 *
 * @return a/the list of stations that are within the radius
 *///from   w  ww . j a  va 2s  . c om
public static List<CFStation> lookup(final String pointX, final String pointY, final String radius) {
    if (Log.isLoggable(TAG, Log.DEBUG))
        Log.d(TAG, "Enter: lookup()");
    Assert.assertNotNull(pointX);
    Assert.assertFalse(pointX.length() == 0);
    Assert.assertNotNull(pointY);
    Assert.assertFalse(pointY.length() == 0);
    Assert.assertNotNull(radius);
    Assert.assertFalse(radius.length() == 0);

    if (Log.isLoggable(TAG, Log.VERBOSE))
        Log.v(TAG, "pointX:" + pointX);
    if (Log.isLoggable(TAG, Log.VERBOSE))
        Log.v(TAG, "pointY:" + pointY);
    if (Log.isLoggable(TAG, Log.VERBOSE))
        Log.v(TAG, "radius:" + radius);

    if (Log.isLoggable(TAG, Log.VERBOSE))
        Log.v(TAG, "create the list we will return ...");
    List<CFStation> stations = new ArrayList<CFStation>();

    if (Log.isLoggable(TAG, Log.VERBOSE))
        Log.v(TAG, "create http client ...");
    HttpClient httpClient = new DefaultHttpClient();
    Assert.assertNotNull(httpClient);

    String url = "" + BASE_URL + "?point_x=" + pointX + "&point_y=" + pointY + "&radius=" + radius;
    if (Log.isLoggable(TAG, Log.VERBOSE))
        Log.v(TAG, "URL:" + url);

    if (Log.isLoggable(TAG, Log.VERBOSE))
        Log.v(TAG, "go and do it ...");
    HttpResponse response = null;
    try {
        response = httpClient.execute(new HttpGet(url));
        Assert.assertNotNull(response);
    } catch (Exception e) {
        e.printStackTrace();
        Assert.fail();
    }

    if (Log.isLoggable(TAG, Log.VERBOSE))
        Log.v(TAG, "process response ...");
    JSONArray stationsObject = null;
    try {
        HttpEntity entity = response.getEntity();
        Assert.assertNotNull(entity);

        String resultString = getString(entity.getContent());
        Assert.assertNotNull(resultString);
        if (Log.isLoggable(TAG, Log.VERBOSE))
            Log.v(TAG, "Result:" + resultString);

        JSONObject resultObject = new JSONObject(resultString);
        Assert.assertNotNull(resultObject);

        stationsObject = resultObject.getJSONArray("stations");
        Assert.assertNotNull(stationsObject);
    } catch (Exception e) {
        e.printStackTrace();
        Assert.fail();
    }

    if (Log.isLoggable(TAG, Log.VERBOSE))
        Log.v(TAG, "build list of stations ...");
    try {
        for (int i = 0; i < stationsObject.length(); i++) {
            JSONObject station = stationsObject.getJSONObject(i);
            Assert.assertNotNull(station);

            CFStation newStation = new CFStation();
            newStation.setName(station.getString("name"));
            newStation.setX(station.getDouble("st_x"));
            newStation.setY(station.getDouble("st_y"));

            Assert.assertTrue(stations.add(newStation));
        }
    } catch (Exception e) {
        e.printStackTrace();
        Assert.fail();
    }

    if (Log.isLoggable(TAG, Log.DEBUG))
        Log.d(TAG, "Leave: lookup()");
    return stations;
}

From source file:org.fs.core.AbstractPagerAdapter.java

protected final void log(final String str) {
    log(Log.DEBUG, str);
}

From source file:com.granita.icloudcalsync.webdav.DavHttpClient.java

@SuppressLint("LogTagMismatch")
public static CloseableHttpClient create() {
    PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(
            socketFactoryRegistry);/*from   ww  w.j a v  a 2  s  .  c  o m*/
    // limits per DavHttpClient (= per DavSyncAdapter extends AbstractThreadedSyncAdapter)
    connectionManager.setMaxTotal(3); // max.  3 connections in total
    connectionManager.setDefaultMaxPerRoute(2); // max.  2 connections per host

    HttpClientBuilder builder = HttpClients.custom().useSystemProperties()
            .setConnectionManager(connectionManager).setDefaultRequestConfig(defaultRqConfig)
            .setRetryHandler(DavHttpRequestRetryHandler.INSTANCE)
            .setRedirectStrategy(DavRedirectStrategy.INSTANCE)
            .setUserAgent("DAVdroid/" + Constants.APP_VERSION);

    if (Log.isLoggable("Wire", Log.DEBUG)) {
        Log.i(TAG, "Wire logging active, disabling HTTP compression");
        builder = builder.disableContentCompression();
    }

    return builder.build();
}