Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
cb4f68c6
Commit
cb4f68c6
authored
Apr 02, 2021
by
刘鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: net阿里云埋点增加方法,platform增加丰富参数埋点,方便后续定位问题
parent
8d64a578
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
7 deletions
+67
-7
MainActivity.kt
app/src/main/java/com/ydl/component/MainActivity.kt
+3
-0
config.gradle
config.gradle
+5
-5
AliYunLogHelper.kt
ydl-net/src/main/java/com/ydl/ydlnet/utils/log/AliYunLogHelper.kt
+10
-2
AliYunRichLogsHelper.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/log/AliYunRichLogsHelper.kt
+49
-0
No files found.
app/src/main/java/com/ydl/component/MainActivity.kt
View file @
cb4f68c6
...
...
@@ -33,6 +33,8 @@ import kotlinx.android.synthetic.main.activity_main.*
import
com.ydl.component.route.PlatformTempCommonRouteImpl
import
com.ydl.confide.home.ConfideHomeActivity
import
com.ydl.ydlcommon.router.YdlCommonRouterManager
import
com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
import
com.ydl.ydlnet.utils.log.AliYunLogConfig
import
com.yidianling.common.tools.LogUtil
import
com.yidianling.consultant.api.IConsultantService
import
com.yidianling.user.StatusUtils
...
...
@@ -89,6 +91,7 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
tv_home
?.
setOnClickListener
{
mPresenter
.
loadHome
()
AliYunRichLogsHelper
.
getInstance
().
sendRichLog
(
AliYunLogConfig
.
LOGIN
,
"测试测试啊"
)
}
bt_to_other
.
setOnClickListener
{
...
...
config.gradle
View file @
cb4f68c6
...
...
@@ -5,7 +5,7 @@ ext {
ydlPublishVersion
=
[
// -------------- 业务模块 --------------
//第三步 若干
"m-confide"
:
"0.0.49.0
4
"
,
"m-confide"
:
"0.0.49.0
5
"
,
"m-consultant"
:
"0.0.59.68"
,
"m-fm"
:
"0.0.30.01"
,
"m-user"
:
"0.0.61.24"
,
...
...
@@ -39,12 +39,12 @@ ext {
"ydl-webview"
:
"0.0.38.38"
,
"ydl-media"
:
"0.0.21.6"
,
"ydl-pay"
:
"0.0.18.16"
,
"m-audioim"
:
"0.0.49.29.3
3
"
,
"m-audioim"
:
"0.0.49.29.3
4
"
,
"ydl-flutter-base"
:
"0.0.14.20"
,
//以下 几乎不会动
"router"
:
"0.0.1"
,
"ydl-net"
:
"0.0.3.
6
"
,
"ydl-net"
:
"0.0.3.
8
"
,
"ydl-utils"
:
"0.0.3.1"
,
]
ydl_app
=
[
...
...
@@ -121,12 +121,12 @@ ext {
"ydl-webview"
:
"0.0.38.38"
,
"ydl-media"
:
"0.0.21.6"
,
"ydl-pay"
:
"0.0.18.16"
,
"m-audioim"
:
"0.0.49.29.3
3
"
,
"m-audioim"
:
"0.0.49.29.3
4
"
,
"ydl-flutter-base"
:
"0.0.14.20"
,
//以下 几乎不会动
"router"
:
"0.0.1"
,
"ydl-net"
:
"0.0.3.
6
"
,
"ydl-net"
:
"0.0.3.
8
"
,
"ydl-utils"
:
"0.0.3.1"
,
]
...
...
ydl-net/src/main/java/com/ydl/ydlnet/utils/log/AliYunLogHelper.kt
View file @
cb4f68c6
package
com.ydl.ydlnet.utils.log
import
android.util.Log
import
com.aliyun.sls.android.producer.*
class
AliYunLogHelper
{
...
...
@@ -43,7 +42,15 @@ class AliYunLogHelper {
log
.
putContent
(
key
,
value
)
if
(
mClient
!=
null
)
{
val
res
:
LogProducerResult
=
mClient
!!
.
addLog
(
log
)
Log
.
d
(
"LogProducerResult"
,
String
.
format
(
"%s %s"
,
res
,
res
.
isLogProducerResultOk
))
}
}
/**
* @param log 子类调用,传递更多参数
* */
fun
sendLog
(
log
:
Log
)
{
if
(
mClient
!=
null
)
{
val
res
:
LogProducerResult
=
mClient
!!
.
addLog
(
log
)
}
}
}
\ No newline at end of file
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/log/AliYunRichLogsHelper.kt
0 → 100644
View file @
cb4f68c6
package
com.ydl.ydlcommon.utils.log
import
com.aliyun.sls.android.producer.Log
import
com.ydl.ydlcommon.base.BaseApp.Companion.getApp
import
com.ydl.ydlcommon.data.PlatformDataManager.getRam
import
com.ydl.ydlcommon.modular.ModularServiceManager.getPlatformUserService
import
com.ydl.ydlnet.utils.log.AliYunLogHelper
import
com.yidianling.common.tools.RxAppTool
import
com.yidianling.common.tools.RxDeviceTool
/**
* @author liupeng
*
* 阿里云埋点,携带基本参数,方便后续排查问题定位
* */
class
AliYunRichLogsHelper
{
companion
object
{
fun
getInstance
():
AliYunRichLogsHelper
{
return
Holder
.
INSTANCE
}
}
private
object
Holder
{
val
INSTANCE
=
AliYunRichLogsHelper
()
}
/**
*
* @param key AliYunLogConfig 接口、登录、声网、WebView、支付、其他
* @param value 具体的状态值
* */
fun
sendRichLog
(
key
:
String
,
value
:
String
)
{
val
log
=
Log
()
val
userInfo
=
getPlatformUserService
()
!!
.
getUser
()
log
.
putContent
(
key
,
value
)
log
.
putContent
(
"ffrom"
,
getRam
().
getChannelName
())
log
.
putContent
(
"isFromApp"
,
"1"
)
log
.
putContent
(
"osBuild"
,
RxDeviceTool
.
getBuildBrandModel
())
log
.
putContent
(
RxDeviceTool
.
getSDKVersionName
(),
RxAppTool
.
getAppVersionName
(
getApp
()))
log
.
putContent
(
"version"
,
RxAppTool
.
getAppVersionName
(
getApp
()))
if
(
null
!=
userInfo
)
{
log
.
putContent
(
"uid"
,
userInfo
.
userId
)
log
.
putContent
(
"accessToken"
,
userInfo
.
token
)
}
AliYunLogHelper
.
getInstance
().
sendLog
(
log
)
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment