Sync debug value to Logger

This commit is contained in:
Mygod
2020-07-10 04:33:58 +08:00
parent 78f32cde3c
commit 14beddd0dd
2 changed files with 20 additions and 15 deletions

View File

@@ -16,7 +16,7 @@ object RootManager : RootSession() {
@Parcelize
class RootInit : RootCommandNoResult {
override suspend fun execute(): Parcelable? {
RootServer.DEBUG = BuildConfig.DEBUG
RootServer.isDebugEnabled = BuildConfig.DEBUG
Timber.plant(object : Timber.DebugTree() {
override fun log(priority: Int, tag: String?, message: String, t: Throwable?) {
if (priority >= Log.WARN) System.err.println("$priority/$tag: $message")
@@ -36,7 +36,7 @@ object RootManager : RootSession() {
override fun createServer() = RootServer { Timber.w(it) }
override suspend fun initServer(server: RootServer) {
RootServer.DEBUG = BuildConfig.DEBUG
RootServer.isDebugEnabled = BuildConfig.DEBUG
try {
server.init(app)
} finally {