com.orhanobut.logger.Logger.wtf()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(269)

本文整理了Java中com.orhanobut.logger.Logger.wtf()方法的一些代码示例,展示了Logger.wtf()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger.wtf()方法的具体详情如下:
包路径:com.orhanobut.logger.Logger
类名称:Logger
方法名:wtf

Logger.wtf介绍

[英]Tip: Use this for exceptional situations to log ie: Unexpected errors etc
[中]提示:在异常情况下使用此选项记录ie:意外错误等

代码示例

代码示例来源:origin: jaydenxiao2016/AndroidFire

  1. public static void logwtf(String message, Object... args) {
  2. if (DEBUG_ENABLE) {
  3. Logger.wtf(message, args);
  4. }
  5. }

代码示例来源:origin: flyve-mdm/android-mdm-agent

  1. /**
  2. * send What a Terrible Failure log message
  3. * @param message String message
  4. * @param args Objects
  5. */
  6. public static void wtf(String message, Object... args) {
  7. Logger.wtf(message, args);
  8. }

代码示例来源:origin: xiaoxiangyeyuHeaven/HeavenlyModule

  1. public static void logwtf(String message, Object... args) {
  2. if (DEBUG_ENABLE) {
  3. Logger.wtf(message, args);
  4. }
  5. }

代码示例来源:origin: wangfeng19930909/BaseMVP-master

  1. public static void logwtf(String message, Object... args) {
  2. if (DEBUG_ENABLE) {
  3. Logger.wtf(message, args);
  4. }
  5. }

代码示例来源:origin: renyuneyun/Easer

  1. @Override
  2. public void onReceive(Context context, Intent intent) {
  3. final String action = intent.getAction();
  4. if (ACTION_LOAD_PROFILE.equals(action)) {
  5. final String name = intent.getStringExtra(EXTRA_PROFILE_NAME);
  6. final String event = intent.getStringExtra(EXTRA_SCRIPT_NAME);
  7. if (intent.getExtras() == null) {
  8. Logger.wtf("ProfileLoaderIntent has null extras???");
  9. throw new IllegalStateException("ProfileLoaderIntent has null extras???");
  10. }
  11. handleActionLoadProfile(name, event, intent.getExtras());
  12. } else {
  13. Logger.wtf("ProfileLoaderService got unknown Intent action <%s>", action);
  14. }
  15. }
  16. };

代码示例来源:origin: aint/laverna-android

  1. /**
  2. * A method which cuts everything before the task brackets.
  3. * @param line a line with the task.
  4. * @return the task text.
  5. * @throws RuntimeException in case if Parser filtered line with a task normally, but couldn't find task then
  6. */
  7. private static String getTask(String line) {
  8. Matcher matcher = Pattern.compile(TASK_REGEX).matcher(line);
  9. if (matcher.find()) {
  10. return matcher.group(0);
  11. }
  12. Logger.wtf("Parser filtered line with a task normally, but couldn't find task then");
  13. throw new RuntimeException();
  14. }

代码示例来源:origin: aint/laverna-android

  1. /**
  2. * A method which finds and replaces task's brackets to checkboxes.
  3. * @param text a text to parse.
  4. * @return a text with replacements.
  5. */
  6. private String replaceTasks(String text) {
  7. Matcher lineWithTaskMatcher = Pattern.compile(LINE_WITH_TASK_REGEX).matcher(text);
  8. while (lineWithTaskMatcher.find()) {
  9. String lineWithTask = lineWithTaskMatcher.group();
  10. Matcher pureTaskMatcher = Pattern.compile(TASK_REGEX).matcher(lineWithTask);
  11. if (pureTaskMatcher.find()) {
  12. text = text.replace(lineWithTask, replaceBracketsWithCheckboxTag(pureTaskMatcher.group(0)));
  13. continue;
  14. }
  15. Logger.wtf("Parser filtered line with a task normally, but couldn't find task then");
  16. throw new RuntimeException();
  17. }
  18. return text;
  19. }

代码示例来源:origin: renyuneyun/Easer

  1. @Override
  2. public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
  3. switch (requestCode) {
  4. case REQCODE_PERM_STORAGE:
  5. case REQCODE_PERM_EXPORT:
  6. case REQCODE_PERM_IMPORT:
  7. if (grantResults.length == 0) {
  8. Logger.wtf("Request permission result with ZERO length!!!");
  9. return;
  10. }
  11. if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
  12. Logger.i("Request for permission <%s> granted", permissions[0]);
  13. } else {
  14. Logger.i("Request for permission <%s> denied", permissions[0]);
  15. }
  16. break;
  17. }
  18. }

代码示例来源:origin: renyuneyun/Easer

  1. WifiTracker(Context context, WifiConditionData data,
  2. @NonNull PendingIntent event_positive,
  3. @NonNull PendingIntent event_negative) {
  4. super(context, data, event_positive, event_negative);
  5. WifiManager wifiManager = (WifiManager) context.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
  6. if (wifiManager == null) {
  7. Logger.wtf("[WifiTracker] WifiManager is null");
  8. return;
  9. }
  10. if (wifiManager.isWifiEnabled()) {
  11. WifiInfo wifiInfo = wifiManager.getConnectionInfo();
  12. compareAndSignal(wifiInfo);
  13. }
  14. }

代码示例来源:origin: renyuneyun/Easer

  1. protected final void newSatisfiedState(Boolean newState) {
  2. lck_satisfied.lock();
  3. try {
  4. if (satisfied == newState) {
  5. return;
  6. }
  7. satisfied = newState;
  8. if (satisfied == null)
  9. return;
  10. PendingIntent pendingIntent = satisfied ? event_positive : event_negative;
  11. try {
  12. pendingIntent.send();
  13. } catch (PendingIntent.CanceledException e) {
  14. Logger.wtf("PendingIntent for notify in SkeletonTracker cancelled before sending???");
  15. e.printStackTrace();
  16. }
  17. } finally {
  18. lck_satisfied.unlock();
  19. }
  20. }

代码示例来源:origin: aint/laverna-android

  1. @Override
  2. public Note getNoteByTask(Task task) {
  3. mNoteService.openConnection();
  4. Optional<Note> noteOptional = mNoteService.getById(task.getNoteId());
  5. mNoteService.closeConnection();
  6. if (noteOptional.isPresent()) {
  7. return noteOptional.get();
  8. }
  9. Logger.wtf("Task exists without note");
  10. throw new RuntimeException();
  11. }
  12. }

代码示例来源:origin: renyuneyun/Easer

  1. @Override
  2. public boolean load(@ValidData @NonNull UiModeOperationData data) {
  3. UiModeManager uiModeManager = (UiModeManager) context.getSystemService(Context.UI_MODE_SERVICE);
  4. if (uiModeManager == null) {
  5. Logger.wtf("Can't get UiModeManager???");
  6. return false;
  7. }
  8. if (data.ui_mode == UiModeOperationData.UiMode.car) {
  9. uiModeManager.enableCarMode(0);
  10. } else { // if (data.ui_mode == UiModeOperationData.UiMode.normal) {
  11. uiModeManager.disableCarMode(0);
  12. }
  13. return true;
  14. }
  15. }

代码示例来源:origin: renyuneyun/Easer

  1. WifiManager wifiManager = (WifiManager) context.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
  2. if (wifiManager == null) {
  3. Logger.wtf("[WifiTracker] WifiManager is null");
  4. return;

代码示例来源:origin: huangfangyi/YiChat

  1. public static void wtf(String tag, String message) {
  2. Logger.init(tag)
  3. .methodCount(METHOD_COUNT)
  4. .logLevel(LOG_LEVEL)
  5. .methodOffset(METHOD_OFFSET);
  6. Logger.wtf(message);
  7. }

代码示例来源:origin: renyuneyun/Easer

  1. @Override
  2. public boolean load(@ValidData @NonNull BluetoothOperationData data) {
  3. Boolean state = data.get();
  4. if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
  5. BluetoothManager bluetoothManager = (BluetoothManager) context.getSystemService(Context.BLUETOOTH_SERVICE);
  6. BluetoothAdapter adapter = bluetoothManager.getAdapter();
  7. if (adapter == null) {
  8. Logger.w("no BluetoothAdapter");
  9. return true;
  10. }
  11. if (state) {
  12. return adapter.enable();
  13. } else {
  14. return adapter.disable();
  15. }
  16. }
  17. Logger.wtf("System version lower than min requirement");
  18. return false;
  19. }
  20. }

代码示例来源:origin: aint/laverna-android

  1. @Override
  2. public void saveNewNote(String title, String content, String htmlContent) {
  3. NoteForm noteForm = new NoteForm(CurrentState.profileId, false, mNotebookId, title, content, htmlContent, false);
  4. Flowable.just(noteForm)
  5. .doOnNext(noteFormToSend -> mNoteService.openConnection())
  6. .map(noteFormToSend -> mNoteService.create(noteFormToSend))
  7. .doOnNext(stringOptional -> mNoteService.closeConnection())
  8. .filter(stringOptional -> !stringOptional.isPresent())
  9. .subscribe(stringOptional -> {
  10. Logger.wtf("New note is note created due to unforeseen circumstances.");
  11. throw new RuntimeException();
  12. });
  13. }

代码示例来源:origin: renyuneyun/Easer

  1. break;
  2. default:
  3. Logger.wtf("Unexpected purpose: %s", purpose);
  4. throw new UnsupportedOperationException("Unknown Purpose");

相关文章