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


Java MarkerLog类代码示例

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


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

示例1: finish

import com.android.volley.VolleyLog.MarkerLog; //导入依赖的package包/类
/**
 * 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,代码行数:30,代码来源:Request.java

示例2: finish

import com.android.volley.VolleyLog.MarkerLog; //导入依赖的package包/类
/**
 * 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,代码行数:31,代码来源:Request.java

示例3: logMarkers

import com.android.volley.VolleyLog.MarkerLog; //导入依赖的package包/类
public void logMarkers() {
    if (MarkerLog.ENABLED) {;
        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.finish(this.toString());
                }
            });
            return;
        }
        mEventLog.finish(this.toString());
    }
}
 
开发者ID:patrick-doyle,项目名称:CrossBow,代码行数:18,代码来源:Request.java

示例4: addMarker

import com.android.volley.VolleyLog.MarkerLog; //导入依赖的package包/类
/**
 * 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,代码行数:11,代码来源:Request.java

示例5: finish

import com.android.volley.VolleyLog.MarkerLog; //导入依赖的package包/类
/**
 * 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,代码行数:35,代码来源:Request.java

示例6: finish

import com.android.volley.VolleyLog.MarkerLog; //导入依赖的package包/类
/**
 * 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,代码行数:38,代码来源:Request.java

示例7: addMarker

import com.android.volley.VolleyLog.MarkerLog; //导入依赖的package包/类
/**
 * 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,代码行数:13,代码来源:Request.java


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