GithubHelp home page GithubHelp logo

Missing Timber.v? about timber HOT 6 CLOSED

jakewharton avatar jakewharton commented on July 22, 2024
Missing Timber.v?

from timber.

Comments (6)

JakeWharton avatar JakeWharton commented on July 22, 2024

I didn't think the distinction was useful. Do you use all 5 levels?

from timber.

imminent avatar imminent commented on July 22, 2024

I primarily use v d and e, I guess I can just remap my logs, just curious.
I find it hard to decide the distinctions between log levels sometimes
anyways

On Wednesday, November 20, 2013, Jake Wharton wrote:

I didn't think the distinction was useful. Do you use all 5 levels?

β€”
Reply to this email directly or view it on GitHubhttps://github.com//issues/10#issuecomment-28921939
.

DandrΓ© Allison (323) 823-4456
KeepandShare.com http://www.keepandshare.com

          Schedule & Share. Simply. Securely.

from timber.

JakeWharton avatar JakeWharton commented on July 22, 2024

That's why I axed it down to four. Error: really bad exception, warning: exception but not that bad, info: app flow and status messages, debug: noisy debug-only info.

In my real apps I use the following as the only planted Tree:

package com.squareup.wallet.data;

import com.crashlytics.android.Crashlytics;
import timber.log.Timber;

/**
 * A logging implementation which reports 'info', 'warning', and 'error' logs to Crashlytics.
 */
public class CrashlyticsTree extends Timber.HollowTree {
  @Override public void i(String message, Object... args) {
    logMessage(message, args);
  }

  @Override public void i(Throwable t, String message, Object... args) {
    logMessage(message, args);
    // NOTE: We are explicitly not sending the exception to Crashlytics here.
  }

  @Override public void w(String message, Object... args) {
    logMessage("WARN: " + message, args);
  }

  @Override public void w(Throwable t, String message, Object... args) {
    logMessage("WARN: " + message, args);
    // NOTE: We are explicitly not sending the exception to Crashlytics here.
  }

  @Override public void e(String message, Object... args) {
    logMessage("ERROR: " + message, args);
  }

  @Override public void e(Throwable t, String message, Object... args) {
    logMessage("ERROR: " + message, args);
    Crashlytics.logException(t);
  }

  private void logMessage(String message, Object... args) {
    Crashlytics.log(String.format(message, args));
  }
}

from timber.

imminent avatar imminent commented on July 22, 2024

Got it, nice example.
On Nov 20, 2013 12:42 PM, "Jake Wharton" [email protected] wrote:

That's why I axed it down to four. Error: really bad exception, warning:
exception but not that bad, info: app flow and status messages, debug:
noisy debug-only info.

In my real apps I use the following as the only planted Tree:

package com.squareup.wallet.data;
import com.crashlytics.android.Crashlytics;import timber.log.Timber;
/** * A logging implementation which reports 'info', 'warning', and 'error' logs to Crashlytics. */public class CrashlyticsTree extends Timber.HollowTree {
@OverRide public void i(String message, Object... args) {
logMessage(message, args);
}

@OverRide public void i(Throwable t, String message, Object... args) {
logMessage(message, args);
// NOTE: We are explicitly not sending the exception to Crashlytics here.
}

@OverRide public void w(String message, Object... args) {
logMessage("WARN: " + message, args);
}

@OverRide public void w(Throwable t, String message, Object... args) {
logMessage("WARN: " + message, args);
// NOTE: We are explicitly not sending the exception to Crashlytics here.
}

@OverRide public void e(String message, Object... args) {
logMessage("ERROR: " + message, args);
}

@OverRide public void e(Throwable t, String message, Object... args) {
logMessage("ERROR: " + message, args);
Crashlytics.logException(t);
}

private void logMessage(String message, Object... args) {
Crashlytics.log(String.format(message, args));
}}

β€”
Reply to this email directly or view it on GitHubhttps://github.com//issues/10#issuecomment-28928963
.

from timber.

imminent avatar imminent commented on July 22, 2024

I'm going to close this myself. Thanks

from timber.

Turbo87 avatar Turbo87 commented on July 22, 2024

That's why I axed it down to four. Error: really bad exception, warning: exception but not that bad, info: app flow and status messages, debug: noisy debug-only info.

I'm using that classification too, but I used to log the HTTP traffic with v() so that it can be filtered easily. I would appreciate it if verbose logging could be added too.

from timber.

Related Issues (20)

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.