如何分析融云 SDK 的日志

如何分析融云 SDK 的日志? 如何根据日志排查相应的问题?
发布时间: 2018-08-17 10:49

回答:

  1. 过滤日志

    1. 在你的 Android Studio 的 logcat 中输入 rongLog

    2. 选择 No Filters

  2. 排查链接日志

 D/RongLog: [ RongIMClient ] [connect] ConnectRunnable for connect   //准备链接

 D/RongLog: [ RongIMClient ] initMessageReceiver

 D/RongLog: [ RongIMClient ] onServiceConnected mConnectionStatus = DISCONNECTED // connect 前的链接状态

 D/RongLog: [ RongIMClient ] onStatusChange : cur = DISCONNECTED, to = CONNECTING, retry = 0, cfg = 10  //开始链接,链接状态变化,有 disconnected-> connecting 

 D/RongLog: [ RongIMClient ] [connect] connect  // 执行 connect 方法进行链接

 D/RongLog: [ RongIMClient ] [connect] ConnectRunnable do connect! 

 I/RongLog: [ RongIMClient ] in Foreground  //应用在前台

 D/RongLog: [ RongIMClient ] [connect] callback onComplete   //connect 成功后的回调

 D/RongLog: [ RongIMClient ] onStatusChange : cur = CONNECTING, to = CONNECTED, retry = 0, cfg = 10  //链接成功后的状态变化,有 connecting -> connected


3. 排查收发消息日志

收消息:

I/RongLog: [ RongIMClient ] onReceived : CSc3wbccmZKJowcYkhQ8DB RC:SRSMsg, 7 7, sender = LrkbEaEU5WCuo47MKiU82G, uid = B58M-RPQ3-AMG1-QC4E // 接收到消息:消息的 targetID,消息类型,发送人  

发消息:

08-17 10:45:58.835 10464-10464/? D/RongLog: [ ConversationListFragment ] Message: RC:TxtMsg 8096 PRIVATE SENDING  //会话列表显示正在发送的消息:消息类型,消息 id,会话类型,消息状态

08-17 10:45:58.835 10464-10464/? D/RongLog: [ ConversationFragment ] Event message : 8096, RC:TxtMsg, SENDING  //会话界面显示正在发送的消息:消息类型,消息 id,会话类型,消息状态

08-17 10:45:58.853 10523-11216/? D/RongLog: [ NativeClient ] sendMessage code = 0, id = 8096, uid = B58N-3723-JHS1-QC4E RC:TxtMsg  //消息发送成功后的回调:0代表成功;id 代表该消息在数据库中的索引,必须大于0;uid 代表消息唯一 id;



我对此仍有疑问!继续追问