Java Code Examples for android.util.Log.wtf()

The following are Jave code examples for showing how to use wtf() of the android.util.Log class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: bimdroid   File: BmwIBusService.java   View Source Code Vote up 6 votes
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);
    }
}
 
Example 2
Project: twoh-places-location-api-sample   File: GeocoderIntentService.java   View Source Code Vote up 6 votes
@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);
    }
}
 
Example 3
Project: aarLibrary   File: LogUtils.java   View Source Code Vote up 5 votes
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);
    }
}
 
Example 4
Project: container   File: FileBridge.java   View Source Code Vote up 5 votes
@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();
    }
}
 
Example 5
Project: Songify   File: PlaybackService.java   View Source Code Vote up 5 votes
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;
    }
}
 
Example 6
Project: RabbitCloud   File: PtrCLog.java   View Source Code Vote up 5 votes
/**
 * 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);
}
 
Example 7
Project: 361Camera   File: LogUtil.java   View Source Code Vote up 5 votes
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);
    }
}
 
Example 8
Project: InstantAppStarter   File: ReleaseTree.java   View Source Code Vote up 5 votes
@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);
    }

}
 
Example 9
Project: oneKey2Alarm   File: DBAdapter.java   View Source Code Vote up 5 votes
@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);  
}
 
Example 10
Project: Android-MVVM-Example   File: ReleaseTree.java   View Source Code Vote up 5 votes
@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);
    }
}
 
Example 11
Project: RxJava2RetrofitDemo   File: Timber.java   View Source Code Vote up 5 votes
/**
 * 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);
    }
}
 
Example 12
Project: android-Ultra-Pull-To-Refresh   File: PtrCLog.java   View Source Code Vote up 5 votes
/**
 * 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);
}
 
Example 13
Project: Android-Studio-Plugins   File: BLog.java   View Source Code Vote up 4 votes
public static void wtf(String message) {
    if (IS_LOGGING_ENABLED) {
        Log.wtf(TAG, message);
    }
}
 
Example 14
Project: mobly-bundled-snippets   File: LogSnippet.java   View Source Code Vote up 4 votes
@Rpc(description = "Log at WTF level.")
public void logWtf(String message) {
    Log.wtf(mTag, message);
}
 
Example 15
Project: publicProject   File: VolleyLog.java   View Source Code Vote up 4 votes
public static void wtf(Throwable tr, String format, Object... args) {
    Log.wtf(TAG, buildMessage(format, args), tr);
}
 
Example 16
Project: GitHub   File: LogUtil.java   View Source Code Vote up 4 votes
public static void wtf(String content) {
    if (!x.isDebug()) return;
    String tag = generateTag();

    Log.wtf(tag, content);
}
 
Example 17
Project: TodoRealm   File: LogUtils.java   View Source Code Vote up 4 votes
public static int wtf(String tag, String msg) {
    return Log.wtf(tag, msg, null);
}
 
Example 18
Project: PaoMovie   File: PtrCLog.java   View Source Code Vote up 3 votes
/**
 * Send a FATAL ERROR log message
 *
 * @param tag
 * @param msg
 * @param throwable
 */
public static void f(String tag, String msg, Throwable throwable) {
    if (sLevel > LEVEL_FATAL) {
        return;
    }
    Log.wtf(tag, msg, throwable);
}
 
Example 19
Project: RabbitCloud   File: PtrCLog.java   View Source Code Vote up 3 votes
/**
 * Send a FATAL ERROR log message
 *
 * @param tag
 * @param msg
 * @param throwable
 */
public static void f(String tag, String msg, Throwable throwable) {
    if (sLevel > LEVEL_FATAL) {
        return;
    }
    Log.wtf(tag, msg, throwable);
}
 
Example 20
Project: JD-Test   File: PtrCLog.java   View Source Code Vote up 3 votes
/**
 * Send a FATAL ERROR log message
 *
 * @param tag
 * @param msg
 * @param throwable
 */
public static void f(String tag, String msg, Throwable throwable) {
    if (sLevel > LEVEL_FATAL) {
        return;
    }
    Log.wtf(tag, msg, throwable);
}