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

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

本文整理了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

public static void logwtf(String message, Object... args) {
  if (DEBUG_ENABLE) {
    Logger.wtf(message, args);
  }
}

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

/**
 * send What a Terrible Failure log message
 * @param message String message
 * @param args Objects
 */
public static void wtf(String message, Object... args) {
  Logger.wtf(message, args);
}

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

public static void logwtf(String message, Object... args) {
  if (DEBUG_ENABLE) {
    Logger.wtf(message, args);
  }
}

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

public static void logwtf(String message, Object... args) {
  if (DEBUG_ENABLE) {
    Logger.wtf(message, args);
  }
}

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

@Override
  public void onReceive(Context context, Intent intent) {
    final String action = intent.getAction();
    if (ACTION_LOAD_PROFILE.equals(action)) {
      final String name = intent.getStringExtra(EXTRA_PROFILE_NAME);
      final String event = intent.getStringExtra(EXTRA_SCRIPT_NAME);
      if (intent.getExtras() == null) {
        Logger.wtf("ProfileLoaderIntent has null extras???");
        throw new IllegalStateException("ProfileLoaderIntent has null extras???");
      }
      handleActionLoadProfile(name, event, intent.getExtras());
    } else {
      Logger.wtf("ProfileLoaderService got unknown Intent action <%s>", action);
    }
  }
};

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

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

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

/**
 * A method which finds and replaces task's brackets to checkboxes.
 * @param text a text to parse.
 * @return a text with replacements.
 */
private String replaceTasks(String text) {
  Matcher lineWithTaskMatcher = Pattern.compile(LINE_WITH_TASK_REGEX).matcher(text);
  while (lineWithTaskMatcher.find()) {
    String lineWithTask = lineWithTaskMatcher.group();
    Matcher pureTaskMatcher = Pattern.compile(TASK_REGEX).matcher(lineWithTask);
    if (pureTaskMatcher.find()) {
      text = text.replace(lineWithTask, replaceBracketsWithCheckboxTag(pureTaskMatcher.group(0)));
      continue;
    }
    Logger.wtf("Parser filtered line with a task normally, but couldn't find task then");
    throw new RuntimeException();
  }
  return text;
}

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

@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
  switch (requestCode) {
    case REQCODE_PERM_STORAGE:
    case REQCODE_PERM_EXPORT:
    case REQCODE_PERM_IMPORT:
      if (grantResults.length == 0) {
        Logger.wtf("Request permission result with ZERO length!!!");
        return;
      }
      if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
        Logger.i("Request for permission <%s> granted", permissions[0]);
      } else {
        Logger.i("Request for permission <%s> denied", permissions[0]);
      }
      break;
  }
}

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

WifiTracker(Context context, WifiConditionData data,
        @NonNull PendingIntent event_positive,
        @NonNull PendingIntent event_negative) {
  super(context, data, event_positive, event_negative);
  WifiManager wifiManager = (WifiManager) context.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
  if (wifiManager == null) {
    Logger.wtf("[WifiTracker] WifiManager is null");
    return;
  }
  if (wifiManager.isWifiEnabled()) {
    WifiInfo wifiInfo = wifiManager.getConnectionInfo();
    compareAndSignal(wifiInfo);
  }
}

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

protected final void newSatisfiedState(Boolean newState) {
  lck_satisfied.lock();
  try {
    if (satisfied == newState) {
      return;
    }
    satisfied = newState;
    if (satisfied == null)
      return;
    PendingIntent pendingIntent = satisfied ? event_positive : event_negative;
    try {
      pendingIntent.send();
    } catch (PendingIntent.CanceledException e) {
      Logger.wtf("PendingIntent for notify in SkeletonTracker cancelled before sending???");
      e.printStackTrace();
    }
  } finally {
    lck_satisfied.unlock();
  }
}

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

@Override
  public Note getNoteByTask(Task task) {
    mNoteService.openConnection();
    Optional<Note> noteOptional = mNoteService.getById(task.getNoteId());
    mNoteService.closeConnection();
    if (noteOptional.isPresent()) {
      return noteOptional.get();
    }
    Logger.wtf("Task exists without note");
    throw new RuntimeException();
  }
}

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

@Override
  public boolean load(@ValidData @NonNull UiModeOperationData data) {
    UiModeManager uiModeManager = (UiModeManager) context.getSystemService(Context.UI_MODE_SERVICE);
    if (uiModeManager == null) {
      Logger.wtf("Can't get UiModeManager???");
      return false;
    }
    if (data.ui_mode == UiModeOperationData.UiMode.car) {
      uiModeManager.enableCarMode(0);
    } else { // if (data.ui_mode == UiModeOperationData.UiMode.normal) {
      uiModeManager.disableCarMode(0);
    }
    return true;
  }
}

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

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

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

public static void wtf(String tag, String message) {
  Logger.init(tag)
      .methodCount(METHOD_COUNT)
      .logLevel(LOG_LEVEL)
      .methodOffset(METHOD_OFFSET);
  Logger.wtf(message);
}

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

@Override
  public boolean load(@ValidData @NonNull BluetoothOperationData data) {
    Boolean state = data.get();
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
      BluetoothManager bluetoothManager = (BluetoothManager) context.getSystemService(Context.BLUETOOTH_SERVICE);
      BluetoothAdapter adapter = bluetoothManager.getAdapter();
      if (adapter == null) {
        Logger.w("no BluetoothAdapter");
        return true;
      }
      if (state) {
        return adapter.enable();
      } else {
        return adapter.disable();
      }
    }
    Logger.wtf("System version lower than min requirement");
    return false;
  }
}

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

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

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

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

相关文章