APISonar


com.crashlytics.android.Crashlytics.log

> com > crashlytics > android > Crashlytics > log
com APIs crashlytics APIs android APIs Crashlytics APIs log APIs

Example 1
protected void log(int priority, String tag, String message, Throwable t) {
        if (priority == Log.VERBOSE || priority == Log.DEBUG) {
            return;
        }

        Crashlytics.log(priority, tag, message);

        if (t != null) {
            if (priority == Log.ERROR) {
                Crashlytics.logException(t);
            }
        }

    }
Example 2
public static void log(int i, String s, String s1) {
    if (BuildConfig.DEBUG) {
      Log.println(i, s, s1);
      return;
    }
    try {
      Crashlytics.log(i, s, s1);
    } catch (IllegalStateException e) {
      // This only occurs during unit tests.
    }
  }
Example 3
public static void log(String message) {
        if (!Fabric.isInitialized() || message == null) {
            return;
        }
        Crashlytics.log(message);
    }
Example 4
public long getNumerator() {
		try {
			return mAmount.scaleByPowerOfTen(getScale()).longValueExact();
		} catch (ArithmeticException e) {
			String msg = "Currency " + mCommodity.getCurrencyCode() +
					" with scale " + getScale() +
					" has amount " + mAmount.toString();
			Crashlytics.log(msg);
			Log.e(getClass().getName(), msg);
			throw e;
		}
	}
Example 5
private void logToCrashlytics(String level, String tag, String message, Object... args) {
        if (message == null) {
            return;
        }
        Crashlytics.log(level + "/" + tag + ": " + String.format(message, args));
    }
Example 6
public List<String> generateExport() throws ExporterException {
        String outputFile = getExportCacheFilePath();

        try (CsvWriter csvWriter = new CsvWriter(new FileWriter(outputFile), "" + mCsvSeparator)){
            generateExport(csvWriter);
        } catch (IOException ex){
            Crashlytics.log("Error exporting CSV");
            Crashlytics.logException(ex);
            throw new ExporterException(mExportParams, ex);
        }

        return Arrays.asList(outputFile);
    }
Example 7
private SuraTimingDatabaseHandler(String path) throws SQLException {
    Crashlytics.log("opening gapless data file, " + path);
    try {
      database = SQLiteDatabase.openDatabase(path, null,
          SQLiteDatabase.NO_LOCALIZED_COLLATORS, new DefaultDatabaseErrorHandler());
    } catch (SQLiteDatabaseCorruptException sce) {
      Crashlytics.log("database corrupted: " + path);
      database = null;
    } catch (SQLException se) {
      Crashlytics.log("database at " + path +
          (new File(path).exists() ? " exists" : " doesn't exist"));
      Crashlytics.logException(se);
      database = null;
    }
  }
Example 8
public static void crashlyticsE(String tag, String message) {
        if (BuildConfig.DEBUG) {
            android.util.Log.e(TAG, getMessage(tag, message));
        } else {
            Crashlytics.log(android.util.Log.ERROR, TAG, getMessage(tag, message));
        }
    }
Example 9
public static Transaction from(Cursor cursor) {
        final Transaction transaction = new Transaction();
        if (cursor.getCount() > 0) {
            try {
                transaction.updateFromCursor(cursor, null);
            } catch (Exception e) {
                Crashlytics.log(DatabaseUtils.dumpCurrentRowToString(cursor));
                throw e;
            }
        }
        return transaction;
    }
Example 10
public void onAttach(Activity activity) {
        super.onAttach(activity);
        Crashlytics.log(Log.DEBUG, TAG, mClassName + "#onAttach()");
    }
Example 11
protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Crashlytics.log(Log.DEBUG, TAG, this.getClass().getSimpleName() + "#onCreate()");
    }
Example 12
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        super.onCreateView(inflater, container, savedInstanceState);
        Crashlytics.log(Log.DEBUG, TAG, mClassName + "#onCreateView()");
        return null;
    }
Example 13
public Commodity getCommodity(String currencyCode){
        Cursor cursor = fetchAllRecords(CommodityEntry.COLUMN_MNEMONIC + "=?", new String[]{currencyCode}, null);
        Commodity commodity = null;
        if (cursor.moveToNext()){
            commodity = buildModelInstance(cursor);
        } else {
            String msg = "Commodity not found in the database: " + currencyCode;
            Log.e(LOG_TAG, msg);
            Crashlytics.log(msg);
        }
        cursor.close();
        return commodity;
    }
Example 14
public void migrate(DynamicRealm realm, long oldVersion, long newVersion) {
        RealmSchema schema = realm.getSchema();
        Crashlytics.log(Log.INFO, TAG, "MIGRATING DATABASE from v" + oldVersion + " to v" + newVersion);

        // why < 2? because I forgot to assign a schema version until I wrote this migration, so the
        // oldVersion here will be whatever default is assigned by Realm
        if (oldVersion < 2) {
            if (!schema.get("Post").hasField("customExcerpt")) {
                Crashlytics.log(Log.DEBUG, TAG, "ADDING CUSTOM EXCERPT FIELD TO POST TABLE");
                schema.get("Post").addField("customExcerpt", String.class);
            }
            oldVersion = 2;
        }
    }
Example 15
public static void logException(String tag, String message, @Nullable Throwable throwable) {
        if (BuildConfig.DEBUG) {
            Log.e(tag, message + "\nThrowable: " + (throwable != null ? throwable.getMessage() : null));
            if (throwable != null) {
                throwable.printStackTrace();
            }
        } else {
            Crashlytics.log(Log.ERROR, tag, message + "\nThrowable: " + (throwable != null ? throwable.getMessage() : null));
            Crashlytics.logException(throwable);
        }
    }
Example 16
public void start(OkHttpClient httpClient) {
        Crashlytics.log(Log.DEBUG, TAG, "Initializing NetworkService...");
        getBus().register(this);
        if (AccountManager.hasActiveBlog()) {
            BlogMetadata activeBlog = AccountManager.getActiveBlog();
            GhostApiService api = GhostApiUtils.getRetrofit(activeBlog.getBlogUrl(), httpClient)
                    .create(GhostApiService.class);
            setApiService(activeBlog.getBlogUrl(), api);

            mRealm = Realm.getInstance(activeBlog.getDataRealmConfig());
            mAuthToken = new AuthToken(mRealm.where(AuthToken.class).findFirst());
        }
    }
Example 17
public Intent manageRepos(Uri uri) {

    uri = normalizeUri(uri);
    RepoInfo repoInfo = gitsakriosUriManager.getRepoInfo(uri);
    if (Fabric.isInitialized()) {
      Crashlytics.log(uri.toString());
    }
    return RepoDetailActivity.createLauncherIntent(context, repoInfo);
  }
Example 18
public void onCreatePostEvent(final CreatePostEvent event) {
        Crashlytics.log(Log.DEBUG, TAG, "[onCreatePostEvent] creating new post");
        Post newPost = new Post();
        newPost.addPendingAction(PendingAction.CREATE);
        newPost.setId(getTempUniqueId(Post.class));
        createOrUpdateModel(newPost);                    // save the local post to db
        getBus().post(new PostCreatedEvent(newPost));
        getBus().post(new SyncPostsEvent(false));
    }
Example 19
public void handlePlayback(AudioRequest request) {
    needsPermissionToDownloadOver3g = true;
    final Intent intent = new Intent(this, AudioService.class);
    intent.setAction(AudioService.ACTION_PLAYBACK);
    if (request != null) {
      intent.putExtra(AudioService.EXTRA_PLAY_INFO, request);
      lastAudioRequest = request;
      audioStatusBar.setRepeatCount(request.getRepeatInfo());
      audioStatusBar.switchMode(AudioStatusBar.LOADING_MODE);
    }

    Crashlytics.log("starting service for audio playback");
    startService(intent);
  }
Example 20
public static void startXmlFileChooser(Fragment fragment) {
        Intent pickIntent = new Intent(Intent.ACTION_GET_CONTENT);
        pickIntent.addCategory(Intent.CATEGORY_OPENABLE);
        pickIntent.setType("*/*");
        Intent chooser = Intent.createChooser(pickIntent, "Select GnuCash account file"); //todo internationalize string

        try {
            fragment.startActivityForResult(chooser, REQUEST_PICK_ACCOUNTS_FILE);
        } catch (ActivityNotFoundException ex){
            Crashlytics.log("No file manager for selecting files available");
            Crashlytics.logException(ex);
            Toast.makeText(fragment.getActivity(), R.string.toast_install_file_manager, Toast.LENGTH_LONG).show();
        }
    }