当前位置: 首页>>代码示例>>Java>>正文


Java MarkerLog.ENABLED属性代码示例

本文整理汇总了Java中com.android.volley.VolleyLog.MarkerLog.ENABLED属性的典型用法代码示例。如果您正苦于以下问题:Java MarkerLog.ENABLED属性的具体用法?Java MarkerLog.ENABLED怎么用?Java MarkerLog.ENABLED使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.android.volley.VolleyLog.MarkerLog的用法示例。


在下文中一共展示了MarkerLog.ENABLED属性的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: finish

/**
 * Notifies the request queue that this request has finished (successfully or with error).
 *
 * <p>Also dumps all events from this request's event log; for debugging.</p>
 */
void finish(final String tag) {
    if (mRequestQueue != null) {
        mRequestQueue.finish(this);
    }
    if (MarkerLog.ENABLED) {
        final long threadId = Thread.currentThread().getId();
        if (Looper.myLooper() != Looper.getMainLooper()) {
            // If we finish marking off of the main thread, we need to
            // actually do it on the main thread to ensure correct ordering.
            Handler mainThread = new Handler(Looper.getMainLooper());
            mainThread.post(new Runnable() {
                @Override
                public void run() {
                    mEventLog.add(tag, threadId);
                    mEventLog.finish(this.toString());
                }
            });
            return;
        }

        mEventLog.add(tag, threadId);
        mEventLog.finish(this.toString());
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:29,代码来源:Request.java

示例2: finish

/**
 * Notifies the request queue that this request has finished (successfully or with error).
 *
 * <p>Also dumps all events from this request's event log; for debugging.</p>
 */
void finish(final String tag) {
    if (mRequestQueue != null) {
        mRequestQueue.finish(this);
        onFinish();
    }
    if (MarkerLog.ENABLED) {
        final long threadId = Thread.currentThread().getId();
        if (Looper.myLooper() != Looper.getMainLooper()) {
            // If we finish marking off of the main thread, we need to
            // actually do it on the main thread to ensure correct ordering.
            Handler mainThread = new Handler(Looper.getMainLooper());
            mainThread.post(new Runnable() {
                @Override
                public void run() {
                    mEventLog.add(tag, threadId);
                    mEventLog.finish(this.toString());
                }
            });
            return;
        }

        mEventLog.add(tag, threadId);
        mEventLog.finish(this.toString());
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:30,代码来源:Request.java

示例3: addMarker

/**
 * Adds an event to this request's event log; for debugging.
 */
public void addMarker(String tag) {
    if (MarkerLog.ENABLED) {
        mEventLog.add(tag, Thread.currentThread().getId());
    } else if (mRequestBirthTime == 0) {
        mRequestBirthTime = SystemClock.elapsedRealtime();
    }
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:10,代码来源:Request.java

示例4: finish

/**
 * Notifies the request queue that this request has finished (successfully or with error).
 *
 * <p>Also dumps all events from this request's event log; for debugging.</p>
 */
void finish(final String tag) {
    if (mRequestQueue != null) {
        mRequestQueue.finish(this);
    }
    if (MarkerLog.ENABLED) {
        final long threadId = Thread.currentThread().getId();
        if (Looper.myLooper() != Looper.getMainLooper()) {
            // If we finish marking off of the main thread, we need to
            // actually do it on the main thread to ensure correct ordering.
            Handler mainThread = new Handler(Looper.getMainLooper());
            mainThread.post(new Runnable() {
                @Override
                public void run() {
                    mEventLog.add(tag, threadId);
                    mEventLog.finish(this.toString());
                }
            });
            return;
        }

        mEventLog.add(tag, threadId);
        mEventLog.finish(this.toString());
    } else {
        long requestTime = SystemClock.elapsedRealtime() - mRequestBirthTime;
        if (requestTime >= SLOW_REQUEST_THRESHOLD_MS) {
            VolleyLog.d("%d ms: %s", requestTime, this.toString());
        }
    }
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:34,代码来源:Request.java

示例5: addMarker

/**
 * Adds an event to this request's event log; for debugging.
 */
/*
 * 给 MarkerLog 添加一个 Marker ( Log )
 * 到时候调用 MarkerLog.finish(...) 会一起打印出来
 */
public void addMarker(String tag) {
    if (MarkerLog.ENABLED) {
        mEventLog.add(tag, Thread.currentThread().getId());
    }
}
 
开发者ID:CaMnter,项目名称:SaveVolley,代码行数:12,代码来源:Request.java

示例6: finish

/**
 * Notifies the request queue that this request has finished (successfully or with error).
 *
 * <p>Also dumps all events from this request's event log; for debugging.</p>
 */
void finish(final String tag) {
    if (mRequestQueue != null) {
        mRequestQueue.finish(this);
    }

    onFinish();

    if (MarkerLog.ENABLED) {
        final long threadId = Thread.currentThread().getId();
        if (Looper.myLooper() != Looper.getMainLooper()) {
            // If we finish marking off of the main thread, we need to
            // actually do it on the main thread to ensure correct ordering.
            Handler mainThread = new Handler(Looper.getMainLooper());
            mainThread.post(new Runnable() {
                @Override
                public void run() {
                    mEventLog.add(tag, threadId);
                    mEventLog.finish(this.toString());
                }
            });
            return;
        }

        mEventLog.add(tag, threadId);
        mEventLog.finish(this.toString());
    } else {
        long requestTime = SystemClock.elapsedRealtime() - mRequestBirthTime;
        if (requestTime >= SLOW_REQUEST_THRESHOLD_MS) {
            VolleyLog.d("%d ms: %s", requestTime, this.toString());
        }
    }
}
 
开发者ID:OnelongX,项目名称:GoApp2,代码行数:37,代码来源:Request.java

示例7: finish

/**
 * Notifies the request queue that this request has finished (successfully or with error).
 *
 * <p>Also dumps all events from this request's event log; for debugging.</p>
 */
void finish(final String tag) {
    if (mRequestQueue != null) {
        mRequestQueue.finish(this);
    }
    if (MarkerLog.ENABLED) {
        final long threadId = Thread.currentThread().getId();
        if (Looper.myLooper() != Looper.getMainLooper()) {
            // If we finish marking off of the main thread, we need to
            // actually do it on the main thread to ensure correct ordering.
            Handler mainThread = new Handler(Looper.getMainLooper());
            mainThread.post(new Runnable() {
                @Override
                public void run() {
                    mEventLog.add(tag, threadId);
                    mEventLog.finish(Request.this.toString());
                }
            });
            return;
        }

        mEventLog.add(tag, threadId);
        mEventLog.finish(this.toString());
    } else {
        long requestTime = SystemClock.elapsedRealtime() - mRequestBirthTime;
        if (requestTime >= SLOW_REQUEST_THRESHOLD_MS) {
            VolleyLog.d("%d ms: %s", requestTime, this.toString());
        }
    }
}
 
开发者ID:george-zhang-work,项目名称:dove,代码行数:34,代码来源:Request.java

示例8: finish

/**
 * Notifies the request queue that this request has finished (successfully or with error).
 *
 * <p>Also dumps all events from this request's event log; for debugging.</p>
 */
void finish(final String tag) {
    if (mRequestQueue != null) {
        mRequestQueue.finish(this);
    }
    if (MarkerLog.ENABLED) {
        final long threadId = Thread.currentThread().getId();

        mEventLog.add(tag, threadId);
        mEventLog.finish(this.toString());
    }
}
 
开发者ID:apptik,项目名称:jus,代码行数:16,代码来源:Request.java

示例9: addMarker

/**
 * Adds an event to this request's event log; for debugging.
 */
public void addMarker(String tag) {
    if (MarkerLog.ENABLED) {
        mEventLog.add(tag, Thread.currentThread().getId());
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:Request.java

示例10: finish

/**
 * Notifies the request queue that this request has finished (successfully or with error).
 *
 * <p>Also dumps all events from this request's event log; for debugging.</p>
 */

/*
 * 通知 这个请求 Request 所在的请求队列( RequestQueue )请求已经结束了
 */
void finish(final String tag) {
    // 判断 请求队列 ( RequestQueue ) 是否 为 null
    if (mRequestQueue != null) {
        // 调用 RequestQueue.finish(Request<T> request)
        mRequestQueue.finish(this);
    }
    // 判断 MarkerLog ( VolleyLog ) 的 开关 是否打开
    if (MarkerLog.ENABLED) {
        final long threadId = Thread.currentThread().getId();
        // 如果不在 主( UI ) 线程 中
        if (Looper.myLooper() != Looper.getMainLooper()) {
            // If we finish marking off of the main thread, we need to
            // actually do it on the main thread to ensure correct ordering.

            // 实例化一个 主( UI ) 线程的 Handler
            Handler mainThread = new Handler(Looper.getMainLooper());

            /*
             * 调用刚才实例化的 主( UI ) 线程的 Handler
             * 在 主( UI ) 线程 中打 log
             */
            mainThread.post(new Runnable() {
                @Override public void run() {
                    mEventLog.add(tag, threadId);
                    mEventLog.finish(this.toString());
                }
            });
            // 然后 返回
            return;
        }

        /*
         * 如果上面没有返回,直接到这了,证明是 主( UI ) 线程 中
         * 直接 打 log
         */
        mEventLog.add(tag, threadId);
        mEventLog.finish(this.toString());
    }
}
 
开发者ID:CaMnter,项目名称:SaveVolley,代码行数:48,代码来源:Request.java


注:本文中的com.android.volley.VolleyLog.MarkerLog.ENABLED属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。