Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.SaltedfishCaptain:flog:1.0.2'
}
dependencies {
implementation("com.github.SaltedfishCaptain:flog:1.0.2")
}
<dependency>
<groupId>com.github.SaltedfishCaptain</groupId>
<artifactId>flog</artifactId>
<version>1.0.2</version>
</dependency>
libraryDependencies += "com.github.SaltedfishCaptain" % "flog" % "1.0.2"
:dependencies [[com.github.SaltedfishCaptain/flog "1.0.2"]]
A friendly, flexible, feature-rich and fair logger for Android.
debugCompile 'com.github.SaltedfishCaptain:flog:1.0.1:debug@aar'
releaseCompile 'com.github.SaltedfishCaptain:flog:1.0.1:release@aar'
If you have not use library from JitPack before, you should add this in your project build.gradle.
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
FLog.print("Hello FLog");
FLog.tag("FLog").print("Hello FLog");
FLog.tag("FLog").count(4).showThread().showTime().print("Hello FLog");
FLog.tag("FLog").count(100).excludeThis(this).withJson(JSON_STRING).print("Hello FLog");
FLog.tag("FLog").singleLine().showFooterLine().showHeardLine().print("Hello FLog");
...
This is optional, if you want to use your custom default setting value, you can go on reading.</br> Suggest that call this method only once in Application class, begin with init() and end at anywhere.</br> This setting will just replace the default value at each print.</br> Your new setting at each print will cover this setting.
public class FLogApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
configFLog();
}
private void configFLog() {
FLog.init().count(6).dateFormat("MM_dd hh:mm:ss SSS").v();
}
}
to be continue...
init()...
tag(String tag)
offset(int offset)
count(int count)
exclude(Class<?>... excludeClasses)
excludeThis(Object object)
showThread()
showTime()
withJson(String json)
withObject(String object)
singleLine()
showHeardLine()
showFooterLine()
todo()
d()
e()
w()
i()
v()
print(String message, Object... args)
Apache License 2.0, here is the LICENSE.