一个简单的超链接的日志打印log
Application初始化控制debug&release版打印:
@Override
public void onCreate() {
super.onCreate();
Logger.init(BuildConfig.DEBUG);
}
如果使用了依赖library方式,主module对library module的依赖都是release依赖,所以library中BuildConfig.DEBUG始终为false。
参考:
http://www.jianshu.com/p/1907bffef0a3;
https://juejin.im/search?query=BuildConfig.DEBUG
Step 1. Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
jcenter()
maven { url "https://jitpack.io" }
}
}
Step 2. Add the dependency
dependencies {
compile 'com.github.XYScience:MyLogger:0.2.1'
}