Skip to content

Conversation

@JosephRidge
Copy link

I added more details on the existing documentation file , focusing on the set up process of Timber once the dependencies have been downloaded.

In the documentation of Timber it was not clear on the implementation process in the application in Kotlin, like described in this Fixes #466 #466 (comment).

To fix that, I added the procedure to implement it programmatically in the users code base. It being a documentation update, the necessity of a test was not in mind.

I added the following under the Set Up section.I updated documentation but i can roll back if needed

Step 1 : Create an Application class that inherits from Application class .

open class MyProjectApplication : Application() {
}

Step 2 : import the application package

import android.app.Application

Step 3 : override the onCreate() method and initialize the Timber class

override the onCreate() method in your Application class

open class MyProjectApplication : Application() {
    if (BuildConfig.DEBUG) {
      Timber.plant(new DebugTree());
    } else {
      Timber.plant(new CrashReportingTree());
    }
  ##}

Step 4 : Define it in your Android Manifest , Application tag

In your application tag, add it as a name attribute :

<application  
       ....
       android:name=".MyProjectApplication"
       android:theme="@style/AppTheme"
      .... >

Documentation update by addition of the Set Up section , that describes or provides more details on how to set it up in ones code base.
Comment on lines +125 to +130
open class MyProjectApplication : Application() {
}
```

### Step 2 : import the application package
import android.app.Application
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These steps should be merged.

override the onCreate() method in your Application class
```
open class MyProjectApplication : Application() {
if (BuildConfig.DEBUG) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't place them in onCreate here.

if (BuildConfig.DEBUG) {
Timber.plant(new DebugTree());
} else {
Timber.plant(new CrashReportingTree());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not in the public APIs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

😇 I’d like to add this to the ReadMe Documentation.

2 participants