當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。