forked from orhanobut/logger
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request orhanobut#166 from svenjacobs/feature/nullable_ann…
…otations Add Android support @NonNull/@nullable annotations
- Loading branch information
Showing
25 changed files
with
307 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
#Thu May 25 13:02:58 CEST 2017 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 11 additions & 6 deletions
17
logger/src/main/java/com/orhanobut/logger/AndroidLogAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,28 @@ | ||
package com.orhanobut.logger; | ||
|
||
import android.support.annotation.NonNull; | ||
import android.support.annotation.Nullable; | ||
|
||
import static com.orhanobut.logger.Utils.checkNotNull; | ||
|
||
public class AndroidLogAdapter implements LogAdapter { | ||
|
||
private final FormatStrategy formatStrategy; | ||
@NonNull private final FormatStrategy formatStrategy; | ||
|
||
public AndroidLogAdapter() { | ||
this.formatStrategy = PrettyFormatStrategy.newBuilder().build(); | ||
} | ||
|
||
public AndroidLogAdapter(FormatStrategy formatStrategy) { | ||
this.formatStrategy = formatStrategy; | ||
public AndroidLogAdapter(@NonNull FormatStrategy formatStrategy) { | ||
this.formatStrategy = checkNotNull(formatStrategy); | ||
} | ||
|
||
@Override public boolean isLoggable(int priority, String tag) { | ||
@Override public boolean isLoggable(int priority, @Nullable String tag) { | ||
return true; | ||
} | ||
|
||
@Override public void log(int priority, String tag, String message) { | ||
@Override public void log(int priority, @Nullable String tag, @NonNull String message) { | ||
formatStrategy.log(priority, tag, message); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.