本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}
示例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();
}
}
示例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;
}
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例13: wtf
import android.util.Log; //导入方法依赖的package包/类
public static void wtf(String message) {
if (IS_LOGGING_ENABLED) {
Log.wtf(TAG, message);
}
}
示例14: logWtf
import android.util.Log; //导入方法依赖的package包/类
@Rpc(description = "Log at WTF level.")
public void logWtf(String message) {
Log.wtf(mTag, message);
}
示例15: wtf
import android.util.Log; //导入方法依赖的package包/类
public static void wtf(Throwable tr, String format, Object... args) {
Log.wtf(TAG, buildMessage(format, args), tr);
}