Giter Site home page Giter Site logo

timbertreeutils's Introduction

TimberTreeUtils

Set of timber trees for Crashlytics and debugging.

Usage

This library only contains Timber.Tree implementations. Just plant it to Timber.

Timber.plant(new CrashlyticsLogExceptionTree())

Trees

CrashlyticsLogExceptionTree (Default log level: ERROR)

Sends non-fatal exception to Crashlytics with Crashlytics.logException().

If no throwable is passed, it generates stack trace from caller of Timber.e() or etc. NOTE: Stack trace elements of timber code are automatically removed before sent.

CrashlyticsLogTree (Default log level: WARN)

Records log to Crashlytics with Crashlytics.log().

Recorded logs will be shown in each Crashes/Non-Fatals report.

ThrowErrorTree (Default log level: ERROR)

Throws LogPriorityExceededError (extends Error) if log level exceeds specified level.

Useful when dogfooding, debugging, quality assurance. DON'T plant() this on production environment.

Filtering logs

Specifying minimum log level

CrashlyticsLogTree tree = new CrashlyticsLogTree(Log.INFO);

Excluding log by custom logic

ThrowErrorTree tree = new ThrowErrorTree(Log.ERROR, new LogExclusionStrategy() {
    @Override
    public boolean shouldSkipLog(int priority, String tag, String message, Throwable t) {
        return message.startsWith("NO_FAIL_FAST");
    }
});

Installation

Available from jCenter.

Gradle:

dependencies {
    compile 'net.ypresto.timbertreeutils:timbertreeutils:1.0.0'
}

LICENSE

Copyright (C) 2015 Yuya Tanaka

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

timbertreeutils's People

Contributors

ypresto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

timbertreeutils's Issues

Version 1.0

  • Timber 4.x
  • Fix ErrorLogRecorder to remove internal method calls #4
  • Split CrashlyticsTree into CrashlyticsLogExceptionTree and CrashlyticsLogTree
  • Custom exclusion strategy would be nice..? #6
  • Add test

Tree for logs and throwables

The current CrashlyticsLogExceptionTree sends log messages as exceptions to crashlytics.

I want a tree which reports throwables and also log messages:

if (mLogExclusionStrategy.shouldSkipLog(priority, tag, message, t)) {
    return;
 }

if (t != null) {
    Crashlytics.logException(t);
} else {
    String formattedMessage = LogMessageHelper.format(priority, tag, message);
    Crashlytics.log(formattedMessage);
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.