Java Code Examples for timber.log.Timber#i()

The following examples show how to use timber.log.Timber#i() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BlockingTaskTestMockTransaction.java    From bitgatt with Mozilla Public License 2.0 6 votes vote down vote up
@Override
protected void transaction(GattTransactionCallback callback) {
    super.transaction(callback);
    // let's do something useful with the adapter
    GattUtils utils = new GattUtils();
    boolean is2MsymSupported = false;
    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
        is2MsymSupported = Objects.requireNonNull(utils.getBluetoothAdapter(FitbitGatt.getInstance().getAppContext())).isLe2MPhySupported();
    }
    Timber.i("2 msym is supported? %b", is2MsymSupported);
    startTime = System.currentTimeMillis();
    // we will wait here and let the tx timeout
    synchronized (NAME) {
        try {
            NAME.wait(4000);
        } catch (InterruptedException e) {
            Timber.e(e, "This should fail whatever test, because this is supposed to be blocking");
            callCallbackWithTransactionResultAndRelease(callback, new TransactionResult.Builder().transactionName(NAME).resultStatus(TransactionResult.TransactionResultStatus.FAILURE).build());
        }
    }
}
 
Example 2
Source File: PrayerManager.java    From android with Apache License 2.0 6 votes vote down vote up
private Observable<PrayerContext> updatePrayerContext(Location location) {
    Timber.i("Updating prayer context");

    return mPrayerDownloader.getPrayerTimes(location)
            .doOnNext(new Action1<PrayerContext>() {
                @Override
                public void call(PrayerContext prayerContext) {
                    mLastPrayerContext = prayerContext;
                    broadcastPrayerContext(prayerContext);
                }
            })
            .doOnSubscribe(new Action0() {
                @Override
                public void call() {
                    mIsLoading.set(true);
                }
            })
            .doOnTerminate(new Action0() {
                @Override
                public void call() {
                    mIsLoading.set(false);
                }
            });
}
 
Example 3
Source File: TransactionQueueController.java    From bitgatt with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public void run() {
    Runnable tx;
    while (!stopped.get()) {
        try {
            tx = transactionQueue.take();
            tx.run();
        } catch (InterruptedException e) {
            Timber.i("Thread was interrupted, it's OK, we will retake");
        }
    }
    Timber.i("Thread was stopped");
}
 
Example 4
Source File: SystemStatusService.java    From AirMapSDK-Android with Apache License 2.0 5 votes vote down vote up
public void notifyBrokenComponents(){
    for(SystemStatusComponent component : notNormalComponents){
        Timber.i(component.toString());
        //notifyComponentHealth(component.getName(), component.getLevel());
    }

}
 
Example 5
Source File: SymbolManagerTest.java    From mapbox-plugins-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Test
public void testTextVariableAnchorAsConstant() {
  validateTestSetup();
  setupSymbolManager();
  Timber.i("text-variable-anchor");
  invoke(mapboxMap, (uiController, mapboxMap) -> {
    assertNotNull(symbolManager);

    symbolManager.setTextVariableAnchor(new String[]{TEXT_ANCHOR_RIGHT, TEXT_ANCHOR_TOP});
    assertEquals((String[]) symbolManager.getTextVariableAnchor(), (String[]) new String[]{TEXT_ANCHOR_RIGHT, TEXT_ANCHOR_TOP});
  });
}
 
Example 6
Source File: FillManagerTest.java    From mapbox-plugins-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Test
public void testFillAntialiasAsConstant() {
  validateTestSetup();
  setupFillManager();
  Timber.i("fill-antialias");
  invoke(mapboxMap, (uiController, mapboxMap) -> {
    assertNotNull(fillManager);

    fillManager.setFillAntialias(true);
    assertEquals((Boolean) fillManager.getFillAntialias(), (Boolean) true);
  });
}
 
Example 7
Source File: SymbolTest.java    From mapbox-plugins-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Test
public void testTextField() {
  validateTestSetup();
  setupAnnotation();
  Timber.i("text-field");
  invoke(mapboxMap, (uiController, mapboxMap) -> {
    assertNotNull(symbol);

    symbol.setTextField("");
    assertEquals((String) symbol.getTextField(), (String) "");
  });
}
 
Example 8
Source File: FitbitGatt.java    From bitgatt with Mozilla Public License 2.0 5 votes vote down vote up
/**
 * Will cancel a periodical scan, but will not have any effect if using the background PendingIntent
 * based scanner.  Will not cancel an in progress high priority scan
 *
 * @param context The android context for the scanner
 */
@SuppressWarnings({"unused", "WeakerAccess"}) // API Method
public void cancelPeriodicalScan(@Nullable Context context) {
    if (alwaysConnectedScanner.isAlwaysConnectedScannerEnabled()) {
        Timber.i("You are using the always connected scanner, stop it first before ad-hoc scanning");
        return;
    }
    if (peripheralScanner == null) {
        Timber.w("You are trying to cancel a scan, but the scanner isn't set-up, did you call FitbitGatt#initializeScanner?");
        return;
    }
    peripheralScanner.cancelPeriodicalScan(context);
}
 
Example 9
Source File: DatabaseMaintenanceService.java    From Hentoid with Apache License 2.0 5 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();

    notificationManager = new ServiceNotificationManager(this, 1);
    notificationManager.startForeground(new MaintenanceNotification("Performing maintenance"));

    Timber.i("Service created");
}
 
Example 10
Source File: TelecineTileService.java    From Telecine with Apache License 2.0 5 votes vote down vote up
@Override public void onTileAdded() {
  Timber.i("Quick tile added");
  analytics.send(new HitBuilders.EventBuilder() //
      .setCategory(Analytics.CATEGORY_QUICK_TILE)
      .setAction(Analytics.ACTION_QUICK_TILE_ADDED)
      .build());
}
 
Example 11
Source File: SymbolManagerTest.java    From mapbox-plugins-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Test
public void testTextLineHeightAsConstant() {
  validateTestSetup();
  setupSymbolManager();
  Timber.i("text-line-height");
  invoke(mapboxMap, (uiController, mapboxMap) -> {
    assertNotNull(symbolManager);

    symbolManager.setTextLineHeight(0.3f);
    assertEquals((Float) symbolManager.getTextLineHeight(), (Float) 0.3f);
  });
}
 
Example 12
Source File: SyncAdapter.java    From android-clean-sample-app with MIT License 5 votes vote down vote up
@Override
public void onPerformSync(Account account, Bundle extras, String authority, ContentProviderClient provider,
                          SyncResult syncResult) {
    Timber.i("STARTING SYNC...");

    // initialize the services we will use
    SyncService syncService = RestClient.getService(SyncService.class);

    // TODO: get the real user's name
    Payload payload = new Payload("default");

    // get all unsynced data
    mUnsyncedCosts = mCostRepository.getAllUnsyncedCosts();
    for (Cost cost : mUnsyncedCosts) {

        // convert to models suitable for transferring over network
        RESTCost restCost = RESTModelConverter.convertToRestModel(cost);
        payload.addCost(restCost);
    }

    // run the upload
    try {
        Response<Void> response = syncService.uploadData(payload).execute();

        Timber.i("UPLOAD SUCCESS: %d", response.code());

        // everything went well, mark local cost items as synced
        if (response.isSuccess()) {
            mCostRepository.markSynced(mUnsyncedCosts);
        }

    } catch (IOException e) { // something went wrong
        Timber.e("UPLOAD FAIL");
        // make it a soft error so the framework does the exponential backoff
        syncResult.stats.numIoExceptions += 1;

        Timber.d("Restarting sync in %d seconds", syncResult.delayUntil);
    }
}
 
Example 13
Source File: MultipleRowTextView.java    From jianshi with Apache License 2.0 5 votes vote down vote up
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
  mHeight = measureHeight(heightMeasureSpec);
  mWidth = measureWidth();
  setMeasuredDimension(mWidth, mHeight);
  Timber.i("TextViewVertical width: %s, height: %s", mWidth, mHeight);
}
 
Example 14
Source File: DbMigrationHelper.java    From TowerCollector with Mozilla Public License 2.0 5 votes vote down vote up
public void upgrade(int from, int to) {
    registerScripts(from);
    for (IUpgradeScript script : upgradeScripts) {
        try {
            Timber.i("upgrade(): Executing upgrade script %s", script.getClass().getSimpleName());
            script.performUpgrade(database);
        } catch (RuntimeException ex) {
            Timber.e(ex, "upgrade(): Upgrade script %s failed", script.getClass().getSimpleName());
            throw ex;
        }
    }
}
 
Example 15
Source File: SymbolManagerTest.java    From mapbox-plugins-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Test
public void testTextAllowOverlapAsConstant() {
  validateTestSetup();
  setupSymbolManager();
  Timber.i("text-allow-overlap");
  invoke(mapboxMap, (uiController, mapboxMap) -> {
    assertNotNull(symbolManager);

    symbolManager.setTextAllowOverlap(true);
    assertEquals((Boolean) symbolManager.getTextAllowOverlap(), (Boolean) true);
  });
}
 
Example 16
Source File: PlayerService.java    From Jockey with Apache License 2.0 5 votes vote down vote up
@Override
public void pause() {
    if (!isMusicPlayerReady()) {
        Timber.i("PlayerService.pause(): Service is not ready. Dropping command");
        return;
    }

    try {
        mService.musicPlayer.pause();
    } catch (RuntimeException exception) {
        Timber.e(exception, "Remote call to PlayerService.pause() failed");
        throw exception;
    }
}
 
Example 17
Source File: SplashPresenter.java    From Pioneer with Apache License 2.0 4 votes vote down vote up
@Override
protected void onCancel() {
    Timber.i("onCancel");
}
 
Example 18
Source File: MainService.java    From android with Apache License 2.0 4 votes vote down vote up
@Override
public void handlePrayerContext(PrayerContext prayerContext) {
    Timber.i("Got updated prayer context %s", prayerContext);
}
 
Example 19
Source File: FragmentLifecycleCallbacksImpl.java    From MVPArms with Apache License 2.0 4 votes vote down vote up
@Override
public void onFragmentStopped(@NotNull FragmentManager fm, Fragment f) {
    Timber.i("%s - onFragmentStopped", f.toString());
}
 
Example 20
Source File: BluetoothHandler.java    From blessed-android with MIT License 4 votes vote down vote up
@Override
public void onDiscoveredPeripheral(BluetoothPeripheral peripheral, ScanResult scanResult) {
    Timber.i("Found peripheral '%s'", peripheral.getName());
    central.stopScan();
    central.connectPeripheral(peripheral, peripheralCallback);
}