本文整理匯總了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);
}
示例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..");
}
示例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();
}
示例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);
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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();
}
示例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;
}
}
示例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;
}
示例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);
}
示例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();
}
示例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());
}
示例14: messagesOff
import timber.log.Timber; //導入方法依賴的package包/類
/**
* Stop Lisetenig to incoming messages.
**/
public void messagesOff(){
if (DEBUG) Timber.v("messagesOff");
getNetworkAdapter().getEventManager().messagesOff(entityId);
}
示例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;
}