當前位置: 首頁>>代碼示例>>Java>>正文


Java Log.wtf方法代碼示例

本文整理匯總了Java中android.util.Log.wtf方法的典型用法代碼示例。如果您正苦於以下問題:Java Log.wtf方法的具體用法?Java Log.wtf怎麽用?Java Log.wtf使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.util.Log的用法示例。


在下文中一共展示了Log.wtf方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getBytes

import android.util.Log; //導入方法依賴的package包/類
byte[] getBytes(int elements) {
    if (elements > mSize) {
        Log.wtf(TAG, "Asking for more elements than we have in the buffer." +
                " Buffer size: " + mSize + ", elements requested: " + elements);
        return new byte[]{};
    }

    int virtualPosition = mCurrentIndex - elements;
    if (virtualPosition >= 0) {
        return Arrays.copyOfRange(mBuffer, virtualPosition, mCurrentIndex);
    } else {
        byte[] head = Arrays.copyOfRange(mBuffer, mSize + virtualPosition, mSize);
        if (mCurrentIndex == 0) {
            return head;
        }

        byte[] tail = Arrays.copyOfRange(mBuffer, 0, mCurrentIndex);
        return concatenate(head, tail);
    }
}
 
開發者ID:OpilkiInside,項目名稱:bimdroid,代碼行數:21,代碼來源:BmwIBusService.java

示例2: onHandleIntent

import android.util.Log; //導入方法依賴的package包/類
@Override
protected void onHandleIntent(Intent intent) {

    mReceiver = intent.getParcelableExtra(Constants.RECEIVER);

    // Cek apakah ada receiver untuk menerima hasil
    if (mReceiver == null) {
        Log.wtf(TAG, "Tidak ada receiver, sehingga hasil tidak bisa dikirim");
        return;
    }

    String alamat = intent.getStringExtra(Constants.ADDRESS_DATA_EXTRA);

    if(!TextUtils.isEmpty(alamat)){
        geoCoding(alamat);
    }else{
        reverseGeocoding(intent);
    }
}
 
開發者ID:twoh,項目名稱:twoh-places-location-api-sample,代碼行數:20,代碼來源:GeocoderIntentService.java

示例3: wtf

import android.util.Log; //導入方法依賴的package包/類
public static void wtf(Throwable tr) {
    if (!allowWtf) return;
    StackTraceElement caller = getCallerStackTraceElement();
    String tag = generateTag(caller);

    if (customLogger != null) {
        customLogger.wtf(tag, tr);
    } else {
        Log.wtf(tag, tr);
    }
}
 
開發者ID:LonelyMushroom,項目名稱:aarLibrary,代碼行數:12,代碼來源:LogUtils.java

示例4: run

import android.util.Log; //導入方法依賴的package包/類
@Override
public void run() {
    final byte[] temp = new byte[8192];
    try {
        while (read(mServer, temp, 0, MSG_LENGTH) == MSG_LENGTH) {
            final int cmd = FileUtils.peekInt(temp, 0, ByteOrder.BIG_ENDIAN);
            if (cmd == CMD_WRITE) {
                // Shuttle data into local file
                int len = FileUtils.peekInt(temp, 4, ByteOrder.BIG_ENDIAN);
                while (len > 0) {
                    int n = read(mServer, temp, 0, Math.min(temp.length, len));
                    if (n == -1) {
                        throw new IOException(
                                "Unexpected EOF; still expected " + len + " bytes");
                    }
                    write(mTarget, temp, 0, n);
                    len -= n;
                }

            } else if (cmd == CMD_FSYNC) {
                // Sync and echo back to confirm
                Os.fsync(mTarget);
                write(mServer, temp, 0, MSG_LENGTH);

            } else if (cmd == CMD_CLOSE) {
                // Close and echo back to confirm
                Os.fsync(mTarget);
                Os.close(mTarget);
                mClosed = true;
                write(mServer, temp, 0, MSG_LENGTH);
                break;
            }
        }

    } catch (ErrnoException | IOException e) {
        Log.wtf(TAG, "Failed during bridge", e);
    } finally {
        forceClose();
    }
}
 
開發者ID:codehz,項目名稱:container,代碼行數:41,代碼來源:FileBridge.java

示例5: setSong

import android.util.Log; //導入方法依賴的package包/類
public void setSong(Song song){
    int index = mSongs.indexOf(song);
    // Prevents the case of a song being selected that is not in the mSongs ArrayList (which may
    // occur if the updateSongList method is not invoked before setSong.
    if (index == -1){
        Log.wtf(ERROR_TAG, "song not in index!");
    } else {
        mSongPos = index;
    }
}
 
開發者ID:AkshayPall,項目名稱:Songify,代碼行數:11,代碼來源:PlaybackService.java

示例6: f

import android.util.Log; //導入方法依賴的package包/類
/**
 * Send a FATAL ERROR log message
 *
 * @param tag
 * @param msg
 * @param args
 */
public static void f(String tag, String msg, Object... args) {
    if (sLevel > LEVEL_FATAL) {
        return;
    }
    if (args.length > 0) {
        msg = String.format(msg, args);
    }
    Log.wtf(tag, msg);
}
 
開發者ID:yinyiliang,項目名稱:RabbitCloud,代碼行數:17,代碼來源:PtrCLog.java

示例7: wtf

import android.util.Log; //導入方法依賴的package包/類
public static void wtf(String content, Throwable tr) {
    if (!allowWtf)
        return;
    StackTraceElement caller = getCallerStackTraceElement();
    String tag = generateTag(caller);

    if (customLogger != null) {
        customLogger.wtf(tag, content, tr);
    } else {
        Log.wtf(tag, content, tr);
    }
}
 
開發者ID:gengqifu,項目名稱:361Camera,代碼行數:13,代碼來源:LogUtil.java

示例8: log

import android.util.Log; //導入方法依賴的package包/類
@Override
protected void log(int priority, String tag, String message, Throwable t) {
    if(isLoggable(tag,priority)){

        if(priority == Log.ERROR && t!=null){
            //Send the log to your crashlatics framework
        }

        if(message.length() < MAX_LOG_LENGTH){
            if(priority == Log.ASSERT){
                Log.wtf(tag,message);
            }else {
                Log.println(priority,tag,message);
            }
            return;
        }
    }

    for (int i = 0, length = message.length(); i < length; i++) {
        int newline = message.indexOf('\n', i);
        newline = newline != -1 ? newline : length;
        do {
            int end = Math.min(newline, i + MAX_LOG_LENGTH);
            String part = message.substring(i, end);
            if (priority == Log.ASSERT) {
                Log.wtf(tag, part);
            } else {
                Log.println(priority, tag, part);
            }
            i = end;
        } while (i < newline);
    }

}
 
開發者ID:iamBedant,項目名稱:InstantAppStarter,代碼行數:35,代碼來源:ReleaseTree.java

示例9: onUpgrade

import android.util.Log; //導入方法依賴的package包/類
@Override  
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {  
    // TODO Auto-generated method stub  
    Log.wtf(TAG, "Upgrading database from version "+ oldVersion + "to "+  
     newVersion + ", which will destroy all old data");  
    db.execSQL("DROP TABLE IF EXISTS contacts");  
    onCreate(db);  
}
 
開發者ID:Edward7Zhang,項目名稱:oneKey2Alarm,代碼行數:9,代碼來源:DBAdapter.java

示例10: log

import android.util.Log; //導入方法依賴的package包/類
@Override
protected void log(int priority, String tag, String message, Throwable t) {
    if (message.length() < MAX_LOG_LENGTH) {
        if (priority == Log.ASSERT) {
            Log.wtf(tag, message);
        } else {
            Log.println(priority, tag, message);
        }
        return;
    }

    // Split by line, then ensure each line can fit into Log's maximum length.
    for (int i = 0, length = message.length(); i < length; i++) {
        int newline = message.indexOf('\n', i);
        newline = newline != -1 ? newline : length;
        do {
            int end = Math.min(newline, i + MAX_LOG_LENGTH);
            String part = message.substring(i, end);
            if (priority == Log.ASSERT) {
                Log.wtf(tag, part);
            } else {
                Log.println(priority, tag, part);
            }
            i = end;
        } while (i < newline);
    }
}
 
開發者ID:aprochukhan,項目名稱:Android-MVVM-Example,代碼行數:28,代碼來源:ReleaseTree.java

示例11: log

import android.util.Log; //導入方法依賴的package包/類
/**
 * Break up {@code message} into maximum-length chunks (if needed) and send to either
 * {@link Log#println(int, String, String) Log.println()} or
 * {@link Log#wtf(String, String) Log.wtf()} for logging.
 * <p>
 * {@inheritDoc}
 */
@Override
protected void log(int priority, String tag, String message, Throwable t) {
    if (message.length() < MAX_LOG_LENGTH) {
        if (priority == Log.ASSERT) {
            Log.wtf(tag, message);
        } else {
            Log.println(priority, tag, message);
        }
        return;
    }

    // Split by line, then ensure each line can fit into Log's maximum length.
    for (int i = 0, length = message.length(); i < length; i++) {
        int newline = message.indexOf('\n', i);
        newline = newline != -1 ? newline : length;
        do {
            int end = Math.min(newline, i + MAX_LOG_LENGTH);
            String part = message.substring(i, end);
            if (priority == Log.ASSERT) {
                Log.wtf(tag, part);
            } else {
                Log.println(priority, tag, part);
            }
            i = end;
        } while (i < newline);
    }
}
 
開發者ID:vsona,項目名稱:RxJava2RetrofitDemo,代碼行數:35,代碼來源:Timber.java

示例12: f

import android.util.Log; //導入方法依賴的package包/類
/**
 * Send a FATAL ERROR log message
 *
 * @param tag
 * @param msg
 */
public static void f(String tag, String msg) {
    if (sLevel > LEVEL_FATAL) {
        return;
    }
    Log.wtf(tag, msg);
}
 
開發者ID:sathishmscict,項目名稱:android-Ultra-Pull-To-Refresh,代碼行數:13,代碼來源:PtrCLog.java

示例13: wtf

import android.util.Log; //導入方法依賴的package包/類
public static void wtf(String message) {
    if (IS_LOGGING_ENABLED) {
        Log.wtf(TAG, message);
    }
}
 
開發者ID:balsikandar,項目名稱:Android-Studio-Plugins,代碼行數:6,代碼來源:BLog.java

示例14: logWtf

import android.util.Log; //導入方法依賴的package包/類
@Rpc(description = "Log at WTF level.")
public void logWtf(String message) {
    Log.wtf(mTag, message);
}
 
開發者ID:google,項目名稱:mobly-bundled-snippets,代碼行數:5,代碼來源:LogSnippet.java

示例15: wtf

import android.util.Log; //導入方法依賴的package包/類
public static void wtf(Throwable tr, String format, Object... args) {
    Log.wtf(TAG, buildMessage(format, args), tr);
}
 
開發者ID:wangzhaosheng,項目名稱:publicProject,代碼行數:4,代碼來源:VolleyLog.java


注:本文中的android.util.Log.wtf方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。