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


Java Timber.v方法代码示例

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


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

示例1: intercept

import timber.log.Timber; //导入方法依赖的package包/类
@Override
public Response intercept(@NonNull Chain chain) throws IOException {
    Request originalRequest = chain.request();

    Timber.d("Request URL=%s" + originalRequest.url().encodedPath());
    // Assuming all API endpoints need authorization, we mark with "No-Authorization"
    // in the header those whom don't.
    if (originalRequest.header(NO_AUTHORIZATION) == null) {
        Timber.v("Request with token");
        if (token == null) {
            throw new RuntimeException("Token not present for secured APIs");
        }
        Request authorisedRequest = originalRequest.newBuilder()
                .header(AUTHORIZATION, BEARER + token)
                .build();
        return chain.proceed(authorisedRequest);
    }

    Timber.v("Request without token");
    return chain.proceed(originalRequest);
}
 
开发者ID:davideas,项目名称:AndroidBlueprints,代码行数:22,代码来源:AuthInterceptor.java

示例2: threadOn

import timber.log.Timber; //导入方法依赖的package包/类
public void threadOn(String threadId, Deferred<BThread, Void, Void> deferred){
    if (DEBUG) Timber.v("threadOn, EntityID: %s",threadId);
    if (!isListeningToThread(threadId))
    {
        threadsIds.add(threadId);

        final DatabaseReference threadRef = FirebasePaths.threadRef(threadId);

        // Add an observer to the thread details so we get
        // updated when the thread details change
        DatabaseReference detailsRef = threadRef.child(BFirebaseDefines.Path.BDetailsPath);

        FirebaseEventCombo combo = getCombo(threadId, detailsRef.toString(), new ThreadUpdateChangeListener(threadId, handlerThread, deferred));

        detailsRef.addValueEventListener(combo.getListener());
    }
    else if (DEBUG) Timber.e("Thread is already handled..");

}
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:20,代码来源:FirebaseEventsManager.java

示例3: userOff

import timber.log.Timber; //导入方法依赖的package包/类
@Override
public void userOff(final BUser user){
    if (DEBUG) Timber.v("userOff, EntityID: $s", user.getEntityID());
    
    BThreadWrapper wrapper;
    for (BThread thread : user.getThreads())
    {
        wrapper = new BThreadWrapper(thread);
        
        wrapper.off();
        wrapper.messagesOff();
        wrapper.usersOff();
    }

    post(new Runnable() {
        @Override
        public void run() {
            for (BUser contact : user.getContacts())
                BUserWrapper.initWithModel(contact).metaOff();
        }
    });

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

示例4: releaseWakeLock

import timber.log.Timber; //导入方法依赖的package包/类
public static void releaseWakeLock(Context context, int wakeLockId) {
    Timber.v("CoreReceiver Got request to release wakeLock %d", wakeLockId);

    Intent i = new Intent();
    i.setClass(context, CoreReceiver.class);
    i.setAction(WAKE_LOCK_RELEASE);
    i.putExtra(WAKE_LOCK_ID, wakeLockId);
    context.sendBroadcast(i);
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:10,代码来源:CoreReceiver.java

示例5: 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,项目名称:AndroidBackendlessChat,代码行数:21,代码来源:FirebaseEventsManager.java

示例6: handleTemporaryXoauth2Failure

import timber.log.Timber; //导入方法依赖的package包/类
private List<ImapResponse> handleTemporaryXoauth2Failure(NegativeImapResponseException e) throws IOException, MessagingException {
    //We got a response indicating a retry might suceed after token refresh
    //We could avoid this 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(e, "Temporary failure - retrying with new token");
    try {
        return attemptXOAuth2();
    } catch (NegativeImapResponseException e2) {
        //Okay, we failed on a new token.
        //Invalidate the token anyway but assume it's permanent.
        Timber.v(e, "Authentication exception for new token, permanent error assumed");
        oauthTokenProvider.invalidateToken(settings.getUsername());
        throw handlePermanentXoauth2Failure(e2);
    }
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:18,代码来源:ImapConnection.java

示例7: schedulePushers

import timber.log.Timber; //导入方法依赖的package包/类
private void schedulePushers() {
    int minInterval = -1;

    Collection<Pusher> pushers = MessagingController.getInstance(getApplication()).getPushers();
    for (Pusher pusher : pushers) {
        int interval = pusher.getRefreshInterval();
        if (interval > 0 && (interval < minInterval || minInterval == -1)) {
            minInterval = interval;
        }
    }

    Timber.v("Pusher refresh interval = %d", minInterval);

    if (minInterval > 0) {
        long nextTime = System.currentTimeMillis() + minInterval;
        Timber.d("Next pusher refresh scheduled for %tc", nextTime);

        Intent i = new Intent(this, MailService.class);
        i.setAction(ACTION_REFRESH_PUSHERS);
        BootReceiver.scheduleIntent(MailService.this, nextTime, i);
    }
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:23,代码来源:MailService.java

示例8: activateLock

import timber.log.Timber; //导入方法依赖的package包/类
private void activateLock() {
	Timber.v("lock activated");
	textView.setText(R.string.unlock_instruction);
	recordingMessage.setVisibility(View.GONE);
	hideBorderAnimation();
	unlocked.setVisibility(View.GONE);
	locked.setVisibility(View.VISIBLE);
	hiddenMessage.setBackgroundResource(R.drawable.message_background);
	hiddenMessage.setVisibility(View.VISIBLE);
	initializeTapToUnlock();
}
 
开发者ID:egineering-llc,项目名称:secretknock,代码行数:12,代码来源:MainActivity.java

示例9: readResponse

import timber.log.Timber; //导入方法依赖的package包/类
public ImapResponse readResponse(ImapResponseCallback callback) throws IOException {
    try {
        ImapResponse response = responseParser.readResponse(callback);

        if (K9MailLib.isDebug() && DEBUG_PROTOCOL_IMAP) {
            Timber.v("%s<<<%s", getLogId(), response);
        }

        return response;
    } catch (IOException e) {
        close();
        throw e;
    }
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:15,代码来源:ImapConnection.java

示例10: getWakeLock

import timber.log.Timber; //导入方法依赖的package包/类
private static Integer getWakeLock(Context context) {
    TracingPowerManager pm = TracingPowerManager.getPowerManager(context);
    TracingWakeLock wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "CoreReceiver getWakeLock");
    wakeLock.setReferenceCounted(false);
    wakeLock.acquire(QMail.BOOT_RECEIVER_WAKE_LOCK_TIMEOUT);
    Integer tmpWakeLockId = wakeLockSeq.getAndIncrement();
    wakeLocks.put(tmpWakeLockId, wakeLock);
    Timber.v("CoreReceiver Created wakeLock %d", tmpWakeLockId);
    return tmpWakeLockId;
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:11,代码来源:CoreReceiver.java

示例11: moveOrCopyMessages

import timber.log.Timber; //导入方法依赖的package包/类
private void moveOrCopyMessages(List<? extends Message> messages, String folderName, boolean isMove)
        throws MessagingException {
    String[] uids = new String[messages.size()];

    for (int i = 0, count = messages.size(); i < count; i++) {
        uids[i] = messages.get(i).getUid();
    }
    String messageBody;
    Map<String, String> headers = new HashMap<String, String>();
    Map<String, String> uidToUrl = getMessageUrls(uids);
    String[] urls = new String[uids.length];

    for (int i = 0, count = uids.length; i < count; i++) {
        urls[i] = uidToUrl.get(uids[i]);
        if (urls[i] == null && messages.get(i) instanceof WebDavMessage) {
            WebDavMessage wdMessage = (WebDavMessage) messages.get(i);
            urls[i] = wdMessage.getUrl();
        }
    }

    messageBody = store.getMoveOrCopyMessagesReadXml(urls, isMove);
    WebDavFolder destFolder = (WebDavFolder) store.getFolder(folderName);
    headers.put("Destination", destFolder.folderUrl);
    headers.put("Brief", "t");
    headers.put("If-Match", "*");
    String action = (isMove ? "BMOVE" : "BCOPY");
    Timber.v("Moving %d messages to %s", messages.size(), destFolder.folderUrl);

    store.processRequest(folderUrl, action, messageBody, headers, false);
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:31,代码来源:WebDavFolder.java

示例12: push

import timber.log.Timber; //导入方法依赖的package包/类
/**
 * Push the thread to firebase.
 **/
public Promise<BThread, BError, Void> push(){

    if (DEBUG) Timber.v("push");
    
    final DeferredObject<BThread, BError, Void> deferred = new DeferredObject<>();
    
    DatabaseReference ref = null;
    if (StringUtils.isNotEmpty(model.getEntityID()))
    {
        ref = FirebasePaths.threadRef(model.getEntityID());
    }
    else
    {
        // Creating a new entry for this thread.
        ref = FirebasePaths.threadRef().push();
        model.setEntityID(ref.getKey());
        
        // Updating the database.
        DaoCore.updateEntity(model);
    }
    
    
    ref.updateChildren(serialize(), new DatabaseReference.CompletionListener() {
        @Override
        public void onComplete(DatabaseError firebaseError, DatabaseReference firebase) {
            if (firebaseError != null)
            {
                deferred.reject(getFirebaseError(firebaseError));
            }
            else deferred.resolve(model);
        }
    });
    
    return deferred.promise();
}
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:39,代码来源:BThreadWrapper.java

示例13: userMetaOn

import timber.log.Timber; //导入方法依赖的package包/类
/**
 * Handle user meta change.
 **/
public void userMetaOn(String userID, Deferred<Void, Void, Void> promise){

    if (userID.equals(getCurrentUserId()))
    {
        if (DEBUG) Timber.d("handleUsersDetailsChange, Current User: %s", userID);
        return;
    }

    if (handledUsersMetaIds.contains(userID))
    {
        if (DEBUG) Timber.d("handleUsersDetailsChange, Listening.");
        return;
    }

    handledUsersMetaIds.add(userID);

    final DatabaseReference userRef = FirebasePaths.userMetaRef(userID);

    if (DEBUG) Timber.v("handleUsersDetailsChange, User Ref: %s", userRef.getRef().toString());

    UserMetaChangeListener userMetaChangeListener = new UserMetaChangeListener(userID, promise, handlerUserDetails);

    FirebaseEventCombo combo = getCombo(USER_META_PREFIX  + userID, userRef.toString(), userMetaChangeListener);

    userRef.addValueEventListener(combo.getListener());
}
 
开发者ID:MobileDev418,项目名称:chat-sdk-android-push-firebase,代码行数:30,代码来源:FirebaseEventsManager.java

示例14: messagesOff

import timber.log.Timber; //导入方法依赖的package包/类
/**
 * Stop Lisetenig to incoming messages.
 **/
public void messagesOff(){

    if (DEBUG) Timber.v("messagesOff");
    getNetworkAdapter().getEventManager().messagesOff(entityId);
}
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:9,代码来源:BThreadWrapper.java

示例15: getNotificationLines

import timber.log.Timber; //导入方法依赖的package包/类
private static ArrayList<String> getNotificationLines(Context context, BMessage message, Bundle data){
    List<BThread> threads = BNetworkManager.sharedManager().getNetworkAdapter().currentUserModel().getThreads(BThread.Type.Private);

    if (DEBUG) Timber.v("getNotification, Thread size: %s", threads == null ? "0" : threads.size());

    if (threads == null)
        return new ArrayList<>();

    ArrayList<String> lines = new ArrayList<>();
    ArrayList<String> senders = new ArrayList<>();
    
    int linesCount = 0;
    List<BMessage> m;

    // Getting the lines to use for this message notification
    // A max of three lines could be added from each thread.
    // There is also a max amount of lines to use defined in BDefines.MaxInboxNotificationLines.
    for (BThread t : threads)
    {
        m = t.getMessagesWithOrder(DaoCore.ORDER_DESC);


        if (DEBUG) Timber.v("getNotification, Thread messages size: %s", m.size());

        // Max of three lines from each thread.
        for (int i = 0 ; i < 3; i++){
            if ( validateLinesAndMessagesSize(m, i, lines) )
            {
                addLine(context, m.get(i), lines, senders);
            }
            else break;
        }
        
        // Checking to see that we are still under the max amount of lines to use.
        if (linesCount >= BDefines.Options.MaxInboxNotificationLines)
            break;
    }

    // Creating the title for the notification
    if (senders.size() > 1)
    {
        data.putString(TITLE, StringUtils.join(senders, ", "));
    }
    
    // Adding the lines data
    if (lines.size() > 0)
    {
        data.putStringArrayList(LINES, lines);
        
        // Adding summary, Total amount of unread messages.
        if (lines.size() > 3)
        {
            data.putString(SUMMARY, String.format(context.getString(R.string.not_messages_summary), BNetworkManager.sharedManager().getNetworkAdapter().getUnreadMessagesAmount(false)));
        }
    }
    
    return lines;
}
 
开发者ID:MobileDev418,项目名称:chat-sdk-android-push-firebase,代码行数:59,代码来源:NotificationUtils.java


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