# Chromium 日志记录改造
- websocket消息的记录改造
- vtm 消息的记录改造
- chromium实体状态的记录改造

## entity_onlog

```
{
      "78173721_logType":"entity_onlog",//创建session
      "detail":{
        "entity":"asd",
        "usercode":1234,
        "usercodeStr":"12121",
        "message":"123133",
        "ret":0,//0,success;1,warn;2,error
        "operate":"",
        "retDetail":0,//准确错误码
        "reason":"12345678"
      },
    "threadId": 40584,
    "timestamp": "2024-10-17 15:42:11.399"
}
```

## ws_beginSession
```
{
      "hdl":12345678,//唯一标识一个websocket，由连接时生成
      "78173721_logType":"ws_beginSession",//创建session
      "detail":{
        "web_transID":1234,
        "inner_transID":1234,
        "entity":"GUIConsole",
        "class":"GUIConsoleService",
        "ret":0,//0,success;1,warn;2,error
        "retDetail":0,//准确错误码
        "reason":"12345678",//产生警告的原因和失败原因
        "operate":"",//操作，视ret而不同
        "payload":""
      },
    "threadId": 40584,
    "timestamp": "2024-10-17 15:42:11.399"
}
```

## ws_broadcast
```
{
      "hdl":12345678,//唯一标识一个websocket，由连接时生成
      "78173721_logType":"ws_broadcast",//创建session
      "detail":{
        "entity":"",
        "ret":0,//0,success;1,warn;2,error
        "operate":"",


        "retDetail":0,//准确错误码
        "reason":"12345678",//产生警告的原因和失败原因
        "payload":""
      },
    "threadId": 40584,
    "timestamp": "2024-10-17 15:42:11.399"
}
```

## ws_build
```
{
  "hdl":12345678,//唯一标识一个websocket，由连接时生成
  "78173721_logType":"ws_build",//创建websocket
  "detail":{
    "url":"",
    "isSecurity":1 ,
    
  },
    "threadId": 40584,
    "timestamp": "2024-10-17 15:42:11.399"
}
```

## ws_close
```
{
  "hdl":12345678,//唯一标识一个websocket，由连接时生成
  "78173721_logType":"ws_close",
    "threadId": 40584,
    "timestamp": "2024-10-17 15:42:11.399"
  }
```

## vtm_endsession
```{
      "hdl":12345678,//唯一标识一个websocket，由连接时生成
      "78173721_logType":"vtm_endsession",//创建session
      "detail":{
        "entity":"",
        "sessionId":1234,
        "ret":0,//0,success;1,warn;2,error
        "retDetail":0,//准确错误码
        "reason":"12345678",//产生警告的原因和失败原因
        "operate":"clean",//操作，视ret而不同
        "payload":""
      },
    "threadId": 40584,
    "timestamp": "2024-10-17 15:42:11.399"
}
```

## vtm_event
```
{
      "hdl":12345678,//唯一标识一个websocket，由连接时生成
      "78173721_logType":"vtm_event",//创建session
      "detail":{
        "inner_transID":1234,
        "sessionId":1234,
        "entity":"GUIConsole",
        "ret":0,//0,success;1,warn;2,error
        "operate":"",
        "transIdAndhdl_arr":[{12,12},{23,23}],

        "payload":"",
        "srcByte":"",
        "retDetail":0,//准确错误码
        "reason":"12345678"
      },
    "threadId": 40584,
    "timestamp": "2024-10-17 15:42:11.399"
}
```

## ws_getvar
```
{
      "hdl":12345678,//唯一标识一个websocket，由连接时生成
      "78173721_logType":"ws_getvar",//创建session
      "detail":{
        "web_transID":1234,
        "inner_transID":1234,
        "name":"",
        "ret":0,//0,success;1,warn;2,error
        "operate":"",


        "retDetail":0,//准确错误码
        "reason":"12345678",//产生警告的原因和失败原因
        "payload":""
      },
    "threadId": 40584,
    "timestamp": "2024-10-17 15:42:11.399"
}
```

## ws_info
```
{
      "hdl":12345678,//唯一标识一个websocket，由连接时生成
      "78173721_logType":"ws_info",//创建session
      "detail":{
        "web_transID":1234,
        "sessionId":1234,
        "entity":"GUIConsole",
        "function":"aaa",
        "ret":0,//0,success;1,warn;2,error
        "operate":"",


        "retDetail":0,//准确错误码
        "reason":"12345678",//产生警告的原因和失败原因
        "payload":""
      },
    "threadId": 40584,
    "timestamp": "2024-10-17 15:42:11.399"
}
```

## ws_logEvent
```
{
      "hdl":12345678,//唯一标识一个websocket，由连接时生成
      "78173721_logType":"ws_logEvent",//创建session
      "detail":{
        "securityLevel":1,
        "eventCode":2,
        "message":"123",
        "ret":0,//0,success;1,warn;2,error
        "operate":"",


        "retDetail":0,//准确错误码
        "reason":"12345678",//产生警告的原因和失败原因
        "payload":""
      },
    "threadId": 40584,
    "timestamp": "2024-10-17 15:42:11.399"
}
```

## ws_logWarn
```
{
      "hdl":12345678,//唯一标识一个websocket，由连接时生成
      "78173721_logType":"ws_logWarn",//创建session
      "detail":{
        "securityLevel":1,
        "eventCode":2,
        "message":"123",
        "ret":0,//0,success;1,warn;2,error
        "operate":"",


        "retDetail":0,//准确错误码
        "reason":"12345678",//产生警告的原因和失败原因
        "payload":""
      },
    "threadId": 40584,
    "timestamp": "2024-10-17 15:42:11.399"
}
```

## ws_register
```
{
      "hdl":12345678,//唯一标识一个websocket，由连接时生成
      "78173721_logType":"ws_register",//创建session
      "detail":{
        "web_transID":1234,
        "inner_transID":1234,
        "entity":"GUIConsole",
        "class":"GUIConsoleService",
        "ret":0,//0,success;1,warn;2,error
        "operate":"",


        "retDetail":0,//准确错误码
        "reason":"12345678",//产生警告的原因和失败原因
        "payload":""
      },
    "threadId": 40584,
    "timestamp": "2024-10-17 15:42:11.399"
}
```
## ws_request
``` 
{
      "hdl":12345678,//唯一标识一个websocket，由连接时生成
      "78173721_logType":"ws_request",//创建session
      "detail":{
        "web_transID":1234,
        "inner_transID":1234,
        "sessionId":1234,
        "entity":"GUIConsole",
        "function":"aaa",
        "ret":0,//0,success;1,warn;2,error
        "operate":"",


        "retDetail":0,//准确错误码
        "reason":"12345678",//产生警告的原因和失败原因
        "payload":""
      },
    "threadId": 40584,
    "timestamp": "2024-10-17 15:42:11.399"
}
```

## vtm_requestAck
```
{
      "hdl":12345678,//唯一标识一个websocket，由连接时生成
      "78173721_logType":"vtm_requestAck",//创建session
      "detail":{
        "web_transID":1234,
        "inner_transID":1234,
        "sessionId":1234,
        "entity":"GUIConsole",
        "function":"aaa",
        "ret":0,//0,success;1,warn;2,error
        "operate":"",

        "payload":"",
        "srcByte":"",
        "retDetail":0,//准确错误码
        "reason":"12345678"        
      },
    "threadId": 40584,
    "timestamp": "2024-10-17 15:42:11.399"
}
```

## vtm_sessionAck
```
{
      "hdl":12345678,//唯一标识一个websocket，由连接时生成
      "78173721_logType":"vtm_sessionAck",//创建session
      "detail":{
        "web_transID":1234,
        "inner_transID":1234,
        "sessionId":1234,
        "entity":"GUIConsole",
        "ret":0,//0,success;1,warn;2,error
        "operate":"",

        "payload":"",
        "srcByte":"",
        "retDetail":0,//准确错误码
        "reason":"12345678"
      },
    "threadId": 40584,
    "timestamp": "2024-10-17 15:42:11.399"
}
```
## ws_setvar
```
{
      "hdl":12345678,//唯一标识一个websocket，由连接时生成
      "78173721_logType":"ws_setvar",//创建session
      "detail":{
        "web_transID":1234,
        "inner_transID":1234,
        "name":"",
        "value":"",
        "ret":0,//0,success;1,warn;2,error
        "operate":"",


        "retDetail":0,//准确错误码
        "reason":"12345678",//产生警告的原因和失败原因
        "payload":""
      },
    "threadId": 40584,
    "timestamp": "2024-10-17 15:42:11.399"
}
```

## entity_begin
```
{
      "78173721_logType":"entity_begin",//实体启动
      "detail":{
        "no_startup":0
      },
    "threadId": 40584,
    "timestamp": "2024-10-17 15:42:11.399"
}
```

## entity_openPage
```
{
      "78173721_logType":"entity_openPage",//启动页面
      "detail":{
        "pageType":"123",
        "pid":123033,
        "ret":0,//0,success;1,warn;2,error
        "operate":"",

        "retDetail":0,//准确错误码
        "reason":"12345678",//产生警告的原因和失败原因
      },
    "threadId": 40584,
    "timestamp": "2024-10-17 15:42:11.399"
}
```

## entity_stageChange
```
{
      "78173721_logType":"entity_stageChange",//实体状态变化
      "detail":{
        "stage":"",
        "ret":0,//0,success;1,warn;2,error
        "operate":"",

        "retDetail":0,//准确错误码
        "reason":"12345678",//产生警告的原因和失败原因
      },
    "threadId": 40584,
    "timestamp": "2024-10-17 15:42:11.399"
}
```

## entity_status
```
{
      "78173721_logType":"entity_status",//实体状态变化，记录不重要日志
      "detail":{
        "status":"",
        "level":0,
        "ret":0,//0,success;1,warn;2,error
        "operate":"",

        "retDetail":0,//准确错误码
        "reason":"12345678",//产生警告的原因和失败原因
      },
    "threadId": 40584,
    "timestamp": "2024-10-17 15:42:11.399"
}
```

## entity_basic
```
{
      "78173721_logType":"entity_statChange",//实体状态变化
      "detail":{
        "stage":"",
        "ret":0,//0,success;1,warn;2,error
        "operate":"",

        "retDetail":0,//准确错误码
        "reason":"12345678",//产生警告的原因和失败原因
      },
    "threadId": 40584,
    "timestamp": "2024-10-17 15:42:11.399"
}
```


# 基于改造的日志信息，进行简易的web交互状态分析和画出时序变化图
- 每个改造的日志，都有78173721_logType内容
- 实体启动会发出"78173721_logType":"entity_begin", 每次实体运行过程，从entity_begin到当前最后一个消息
- 首先会根据收到的消息数量，画出饼状图
- 画出消息交互的时序变化图
- 当前开启了一个服务器在http://99.12.43.134:5000中，传入.log文件，则返回web交互分析
- 当前项目只包含实体改造和交互分析的过程图，**并不包含web服务器功能**。