Skip to content

Commit

Permalink
App
Browse files Browse the repository at this point in the history
1, 测试, LogUtil输出效果
2, 添加, HunterDebug
  • Loading branch information
zuilintan committed Oct 31, 2020
1 parent 6730bf3 commit 6fd817c
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
9 changes: 9 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
plugins {
id 'com.android.application'
id 'hunter-debug'
//id 'hunter-linelog'
}

android {
Expand Down Expand Up @@ -29,7 +31,14 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:' + rootProject.ext.dependencies.supportLib
implementation 'com.android.support.constraint:constraint-layout:latest.release'
implementation project(path: ':library')
implementation 'com.quinn.hunter:hunter-debug-library:latest.release'
//implementation 'com.quinn.hunter:hunter-linelog-library:latest.release'
testImplementation 'junit:junit:latest.release'
androidTestImplementation 'com.android.support.test:runner:latest.release'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:latest.release'
}

debugHunterExt {
runVariant = 'ALWAYS' // 'DEBUG','RELEASE','ALWAYS','NEVER','ALWAYS'为默认值
}
28 changes: 27 additions & 1 deletion app/src/main/java/com/lt/person_baseutil/MainActivity.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,39 @@
package com.lt.person_baseutil;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.hunter.library.debug.HunterDebugImpl;
import com.hunter.library.debug.HunterLoggerHandler;
import com.lt.library.util.LogUtil;

public class MainActivity extends AppCompatActivity {

public MainActivity() {
HunterLoggerHandler.installLogImpl(new HunterLoggerHandler() {
@Override
protected void log(String tag, String msg) {
LogUtil.i(tag, msg);
}
});
}

@HunterDebugImpl
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
LogUtil.v("msgV");
LogUtil.v("tagV", "msgV");
LogUtil.d("msgD");
LogUtil.d("tagD", "msgD");
LogUtil.i("msgI");
LogUtil.i("tagI", "msgI");
LogUtil.w("msgW");
LogUtil.w("tagW", "msgW");
LogUtil.e("msgE");
LogUtil.e("tagE", "msgE");
LogUtil.wtf("msgWtf");
LogUtil.wtf("tagWtf", "msgWtf");
}
}

0 comments on commit 6fd817c

Please sign in to comment.