Skip to content

Commit

Permalink
remove logger in module base
Browse files Browse the repository at this point in the history
  • Loading branch information
Reginer committed May 25, 2022
1 parent faef387 commit 4b96073
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ maven { url 'https://jitpack.io' }
```

```
implementation 'com.github.Reginer:MVVMHub:2.1.6'
implementation 'com.github.Reginer:MVVMHub:2.1.7'
```

登录:
Expand Down
1 change: 0 additions & 1 deletion app/src/main/java/win/regin/mvvm/AppMvvm.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package win.regin.mvvm

import android.app.Application
import com.orhanobut.logger.Logger
import win.regin.common.logTagDebug
import win.regin.mvvm.data.BoxManager
import win.regin.mvvm.constant.HubConstant

Expand Down
16 changes: 16 additions & 0 deletions app/src/main/java/win/regin/mvvm/Ext.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package win.regin.mvvm

import android.widget.EditText
import com.orhanobut.logger.AndroidLogAdapter
import com.orhanobut.logger.PrettyFormatStrategy

/**
* @author :Reginer 2021/12/1 15:16.
Expand All @@ -9,4 +11,18 @@ import android.widget.EditText
*/
fun EditText.text():String{
return this.text.toString()
}


/**
* 设置是否打印和打印tag
*/
fun String.logTagDebug(debug: Boolean): AndroidLogAdapter {
val formatStrategy = PrettyFormatStrategy.newBuilder()
.showThreadInfo(false).methodCount(1).tag(this).build()
return object : AndroidLogAdapter(formatStrategy) {
override fun isLoggable(priority: Int, tag: String?): Boolean {
return debug
}
}
}
15 changes: 1 addition & 14 deletions base/src/main/java/win/regin/common/CommonExt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ import com.google.gson.Gson
import com.google.gson.GsonBuilder
import com.google.gson.JsonElement
import com.google.gson.JsonParser
import com.orhanobut.logger.AndroidLogAdapter
import com.orhanobut.logger.PrettyFormatStrategy
import java.lang.reflect.ParameterizedType
import java.lang.reflect.Type

Expand All @@ -48,18 +46,7 @@ import java.lang.reflect.Type
*/


/**
* 设置是否打印和打印tag
*/
fun String.logTagDebug(debug: Boolean): AndroidLogAdapter {
val formatStrategy = PrettyFormatStrategy.newBuilder()
.showThreadInfo(false).methodCount(1).tag(this).build()
return object : AndroidLogAdapter(formatStrategy) {
override fun isLoggable(priority: Int, tag: String?): Boolean {
return debug
}
}
}


/**
* 转换String
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/java/MvvmExt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ object Version {
//http://jcenter.bintray.com/com/squareup/okhttp3/logging-interceptor/
const val materialVersion = "1.4.0"
const val loggerVersion = "2.2.0"
const val libVersionCode = 35
const val libVersionName = "2.1.6"
const val libVersionCode = 36
const val libVersionName = "2.1.7"
}

object MvvmExt {
Expand Down

0 comments on commit 4b96073

Please sign in to comment.