当前位置: 首页>>代码示例>>Java>>正文


Java Timber类代码示例

本文整理汇总了Java中timber.log.Timber的典型用法代码示例。如果您正苦于以下问题:Java Timber类的具体用法?Java Timber怎么用?Java Timber使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Timber类属于timber.log包,在下文中一共展示了Timber类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onThreadDetailsChanged

import timber.log.Timber; //导入依赖的package包/类
@Override
public boolean onThreadDetailsChanged(final String threadId) {
    if (DEBUG) Timber.i("onThreadDetailsChanged");

    for (Event e : events.values())
    {
        if (e  == null)
            continue;

        
        if (StringUtils.isNotEmpty(e.getEntityId()) && !threadId.equals(e.getEntityId()))
            continue;

        if(e instanceof BatchedEvent)
            ((BatchedEvent) e).add(Event.Type.ThreadEvent, threadId);

        e.onThreadDetailsChanged(threadId);
    }

     return false;
}
 
开发者ID:MobileDev418,项目名称:chat-sdk-android-push-firebase,代码行数:22,代码来源:FirebaseEventsManager.java

示例2: removeEventByTag

import timber.log.Timber; //导入依赖的package包/类
/** Removes an app event by tag.*/
@Override
public boolean removeEventByTag(String tag){

    if (DEBUG) Timber.v("removeEventByTag, Tag: %s", tag);

    if (StringUtils.isEmpty(tag)){
        return false;
    }

    Event e = events.remove(tag);
    
    if (e != null)
    {
        if (DEBUG) Timber.i("killing event, Tag: %s", e.getTag());
        e.kill();
    }
    
    return e != null;
}
 
开发者ID:MobileDev418,项目名称:chat-sdk-android-push-firebase,代码行数:21,代码来源:FirebaseEventsManager.java

示例3: setSpeed

import timber.log.Timber; //导入依赖的package包/类
private void setSpeed(Integer left, Integer right) {

        Integer leftSpeed = left==null || left==mLastLeftSpeed? null:left;
        Integer rightSpeed = right==null || right==mLastRightSpeed? null:right;

            if(leftSpeed!=null) mLeftSpeedTextView.setText(""+left);
            if(rightSpeed!=null) mRightSpeedTextView.setText(""+right);

        try {
            com.zugaldia.robocar.mobile.client.RobocarClient service= new RobocarRestClient("http://"+this.mBaseUrl);
            service.setSpeed(leftSpeed, rightSpeed);
            if(left!=null) mLastLeftSpeed = left;
            if(right!=null) mLastRightSpeed = right;
        }catch(Exception e) {
            Toast.makeText(this, "Unable to communicate with Robocar: "+e.getMessage(), Toast.LENGTH_SHORT).show();
            Timber.d(e.getMessage());
        }
    }
 
开发者ID:zugaldia,项目名称:android-robocar,代码行数:19,代码来源:TiltControllerActivity.java

示例4: convert

import timber.log.Timber; //导入依赖的package包/类
/**
 * Convert settings from the internal representation to the string representation used in the
 * preference storage.
 *
 * @param settings
 *         The map of settings to convert.
 * @param settingDescriptions
 *         The structure containing the {@link SettingsDescription} objects that will be used
 *         to convert the setting values.
 *
 * @return The settings converted to the string representation used in the preference storage.
 */
public static Map<String, String> convert(Map<String, Object> settings,
        Map<String, TreeMap<Integer, SettingsDescription>> settingDescriptions) {
    Map<String, String> serializedSettings = new HashMap<>();

    for (Entry<String, Object> setting : settings.entrySet()) {
        String settingName = setting.getKey();
        Object internalValue = setting.getValue();

        TreeMap<Integer, SettingsDescription> versionedSetting = settingDescriptions.get(settingName);
        Integer highestVersion = versionedSetting.lastKey();
        SettingsDescription settingDesc = versionedSetting.get(highestVersion);

        if (settingDesc != null) {
            String stringValue = settingDesc.toString(internalValue);

            serializedSettings.put(settingName, stringValue);
        } else {
            Timber.w("Settings.convert() called with a setting that should have been removed: %s", settingName);
        }
    }

    return serializedSettings;
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:36,代码来源:Settings.java

示例5: onLoadMore

import timber.log.Timber; //导入依赖的package包/类
@Override
public void onLoadMore() {

    if (response.size() == 25){
        try {
            currentPage += 1;
            loadNextPage();
            progressBar.setVisibility(View.GONE);
            isLoading = true;

        } catch (Exception e) {
            e.printStackTrace();
        }
    } else {
        Timber.d("nothing");
    }

}
 
开发者ID:sciage,项目名称:FinalProject,代码行数:19,代码来源:ActivityYourFeedFragment.java

示例6: handleTemporaryFailure

import timber.log.Timber; //导入依赖的package包/类
private void handleTemporaryFailure(String username, NegativeSmtpReplyException negativeResponseFromOldToken)
    throws IOException, MessagingException {
    // Token was invalid

    //We could avoid this double check if we had a reasonable chance of knowing
    //if a token was invalid before use (e.g. due to expiry). But we don't
    //This is the intended behaviour per AccountManager

    Timber.v(negativeResponseFromOldToken, "Authentication exception, re-trying with new token");
    try {
        attemptXoauth2(username);
    } catch (NegativeSmtpReplyException negativeResponseFromNewToken) {
        if (negativeResponseFromNewToken.getReplyCode() != SMTP_AUTHENTICATION_FAILURE_ERROR_CODE) {
            throw negativeResponseFromNewToken;
        }

        //Okay, we failed on a new token.
        //Invalidate the token anyway but assume it's permanent.
        Timber.v(negativeResponseFromNewToken, "Authentication exception for new token, permanent error assumed");

        oauthTokenProvider.invalidateToken(username);

        handlePermanentFailure(negativeResponseFromNewToken);
    }
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:26,代码来源:SmtpTransport.java

示例7: engineSetSeed

import timber.log.Timber; //导入依赖的package包/类
@Override
protected void engineSetSeed(byte[] bytes) {
    try {
        OutputStream out;
        synchronized (sLock) {
            out = getUrandomOutputStream();
        }
        out.write(bytes);
        out.flush();
    } catch (IOException e) {
        // On a small fraction of devices /dev/urandom is not writable.
        // Log and ignore.
        Timber.w("Failed to mix seed into " + URANDOM_FILE);
    } finally {
        mSeeded = true;
    }
}
 
开发者ID:mithrilcoin-io,项目名称:EosCommander,代码行数:18,代码来源:PRNGFixes.java

示例8: getChangePayload

import timber.log.Timber; //导入依赖的package包/类
public static Object getChangePayload(User oldUser, User newUser) {
  Bundle bundle = new Bundle();
  if (!TextUtils.equals(oldUser.getAvatar(), newUser.getAvatar())) {
    bundle.putString(KEY_AVATAR, newUser.getAvatar());
  }
  if (!TextUtils.equals(oldUser.getName(), newUser.getName())) {
    bundle.putString(KEY_NAME, newUser.getName());
  }
  if (!TextUtils.equals(oldUser.getDesc(), newUser.getDesc())) {
    bundle.putString(KEY_DESC, newUser.getDesc());
  }
  if (bundle.size() == 0) {
    return null;
  }
  Timber.d("getChangePayload | size: %d", bundle.size());
  return bundle;
}
 
开发者ID:tranngoclam,项目名称:fast-list,代码行数:18,代码来源:User.java

示例9: handleIntent

import timber.log.Timber; //导入依赖的package包/类
void handleIntent(Context context, @NonNull Intent intent) {
    String intentAction = intent.getAction();

    if (intentAction == null || !PR_NOTIFICATION.equals(intentAction)) {
        return;
    }
    Timber.d("processing " + PR_NOTIFICATION);

    Bundle extras = intent.getExtras();
    if (extras == null) {
        return;
    }

    final String username = extras.getString("username");
    Timber.d("username " + username);

    IntentUtils.triggerPRNotification(context, username);
}
 
开发者ID:handstandsam,项目名称:BuildingDebugFeatures,代码行数:19,代码来源:DebugBroadcastReceiver.java

示例10: parse

import timber.log.Timber; //导入依赖的package包/类
/**
 * Parse a comma separated list of addresses in RFC-822 format and return an
 * array of Address objects.
 *
 * @param addressList
 * @return An array of 0 or more Addresses.
 */
public static Address[] parse(String addressList) {
    if (TextUtils.isEmpty(addressList)) {
        return EMPTY_ADDRESS_ARRAY;
    }
    List<Address> addresses = new ArrayList<>();
    try {
        MailboxList parsedList =  DefaultAddressParser.DEFAULT.parseAddressList(addressList).flatten();

        for (int i = 0, count = parsedList.size(); i < count; i++) {
            Mailbox mailbox = parsedList.get(i);
            addresses.add(new Address(mailbox.getLocalPart() + "@" + mailbox.getDomain(), mailbox.getName(), false));
        }
    } catch (MimeException pe) {
        Timber.e(pe, "MimeException in Address.parse()");
        //but we do an silent failover : we just use the given string as name with empty address
        addresses.add(new Address(null, addressList, false));
    }
    return addresses.toArray(EMPTY_ADDRESS_ARRAY);
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:27,代码来源:Address.java

示例11: render

import timber.log.Timber; //导入依赖的package包/类
@Override public void render(SearchViewState viewState) {
  Timber.d("render %s", viewState);
  if (viewState instanceof SearchViewState.SearchNotStartedYet) {
    renderSearchNotStarted();
  } else if (viewState instanceof SearchViewState.Loading) {
    renderLoading();
  } else if (viewState instanceof SearchViewState.SearchResult) {
    renderResult(((SearchViewState.SearchResult) viewState).getResult());
  } else if (viewState instanceof SearchViewState.EmptyResult) {
    renderEmptyResult();
  } else if (viewState instanceof SearchViewState.Error) {
    Timber.e(((SearchViewState.Error) viewState).getError());
    renderError();
  } else {
    throw new IllegalArgumentException("Don't know how to render viewState " + viewState);
  }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:18,代码来源:SearchFragment.java

示例12: onResumeFragment

import timber.log.Timber; //导入依赖的package包/类
@Override
public void onResumeFragment() {
    super.onResumeFragment();
    Timber.d("onResumeFragment()");
    Helper.hideKeyboard(getActivity());

    final TxData txData = sendListener.getTxData();
    tvTxAddress.setText(txData.getDestinationAddress());
    String paymentId = txData.getPaymentId();
    if ((paymentId != null) && (!paymentId.isEmpty())) {
        tvTxPaymentId.setText(txData.getPaymentId());
    } else {
        tvTxPaymentId.setText("-");
    }

    final PendingTx committedTx = sendListener.getCommittedTx();
    if (committedTx != null) {
        tvTxId.setText(committedTx.txId);
        bCopyTxId.setEnabled(true);
        bCopyTxId.setImageResource(R.drawable.ic_content_copy_black_24dp);
        tvTxAmount.setText(getString(R.string.send_amount, Helper.getDisplayAmount(committedTx.amount)));
        tvTxFee.setText(getString(R.string.send_fee, Helper.getDisplayAmount(committedTx.fee)));
    }
    sendListener.enableDone();
}
 
开发者ID:m2049r,项目名称:xmrwallet,代码行数:26,代码来源:SendSuccessWizardFragment.java

示例13: getNextPage

import timber.log.Timber; //导入依赖的package包/类
public Integer getNextPage() {
    String next = links.get(NEXT_LINK);
    if (next == null) {
        return null;
    }
    Matcher matcher = PAGE_PATTERN.matcher(next);
    if (!matcher.find() || matcher.groupCount() != 1) {
        return null;
    }
    try {
        return Integer.parseInt(matcher.group(1));
    } catch (NumberFormatException ex) {
        Timber.w("cannot parse next page from %s", next);
        return null;
    }
}
 
开发者ID:xiaobailong24,项目名称:MVVMArms,代码行数:17,代码来源:ApiResponse.java

示例14: deleteFileOrDirectory

import timber.log.Timber; //导入依赖的package包/类
private static void deleteFileOrDirectory(File file) {
  if (file.isDirectory()) {
    File[] subFiles = file.listFiles();
    // subFiles is null on some devices, despite this being a directory
    int length = subFiles == null ? 0 : subFiles.length;
    for (int i = 0; i < length; i++) {
      File sf = subFiles[i];
      if (sf.isFile()) {
        if (!sf.delete()) {
          Timber.e("Error deleting %s", sf.getPath());
        }
      } else {
        deleteFileOrDirectory(sf);
      }
    }
  }
  if (!file.delete()) {
    Timber.e("Error deleting %s", file.getPath());
  }
}
 
开发者ID:Elias33,项目名称:Quran,代码行数:21,代码来源:QuranFileUtils.java

示例15: initializeData

import timber.log.Timber; //导入依赖的package包/类
private void initializeData() {

        application.getWebService()
                .getInteractionPosts(likeCounter, MySharedPreferences.getUserId(preferences), MySharedPreferences.getUserToken(preferences))
                .observeOn(AndroidSchedulers.mainThread())
                .subscribeOn(Schedulers.io())
                .retryWhen(new RetryWithDelay(3,2000))
                .subscribe(new BaseSubscriber<PostSuperUserListModel>() {
                    @Override
                    public void onNext(PostSuperUserListModel response) {
                        showRecycleWithDataFilled(response);
                        progressFrame.setVisibility(View.GONE);
                    }
                    @Override
                    public void onError(Throwable e) {
                        progressFrame.setVisibility(View.GONE);
                        try {
                            Timber.e(e.getMessage());
                      //      Toast.makeText(UserHugCounterActivity.this, e.getMessage(), Toast.LENGTH_SHORT).show();
                        }catch (Exception ex){
                            ex.printStackTrace();
                        }
                    }
                });
    }
 
开发者ID:sciage,项目名称:FinalProject,代码行数:26,代码来源:UserHugCounterActivity.java


注:本文中的timber.log.Timber类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。