Commit 9bf2c4da authored by chengkun's avatar chengkun

log.i -> timber

parent 4511959e
......@@ -4,14 +4,17 @@ import com.yidian.bcommon.app.YdBaseApplication
import com.yidian.bcommon.services.ZapServiceNameConstants
import com.yidian.news.util.ProcessUtil
import com.yidian.shenghuoquan.bpush.service.PushService
import com.yidian.yac.core.core.YacModuleSpec
import com.yidian.yac.core.zap.Zap
import timber.log.Timber
@YacModuleSpec
class BPushApplication: YdBaseApplication() {
override fun onCreate() {
super.onCreate()
if (ProcessUtil.isMainProcess(this)) {
registerXpage()
initServie()
initService()
}
}
......@@ -19,7 +22,8 @@ class BPushApplication: YdBaseApplication() {
}
private fun initServie() {
private fun initService() {
Timber.tag("BPushApplication").i("initService")
Zap.addService(ZapServiceNameConstants.BPush, PushService())
}
}
package com.yidian.shenghuoquan.bpush.service
import android.util.Log
import com.yidian.bcommon.services.ZapServiceActionConstants
import com.yidian.xarc.xrouter.ResultResolver
import com.yidian.yac.core.zap.ZapService
import org.json.JSONObject
import timber.log.Timber
class PushService : ZapService() {
private lateinit var resolver: ResultResolver
override fun onAction(path: String, action: String, params: Any, options: Any, resolver: ResultResolver) {
Log.i("PushService", "aciton is " + action)
this.resolver = resolver
params as JSONObject
when(action) {
ZapServiceActionConstants.ActionPushMessage -> pushMessage()
ZapServiceActionConstants.ActionPushMessage -> pushMessage(params.toString())
}
}
......@@ -21,8 +24,8 @@ class PushService : ZapService() {
override fun onInit() {
}
private fun pushMessage() {
private fun pushMessage(message:String) {
Timber.tag("PushService").i(message)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment