123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- #ifndef __MESSAGE_TYPE_H
- #define __MESSAGE_TYPE_H
- #pragma once
- #include <string>
- enum MessageType : int
- {
- Info = 0, //info message, no response
- BeginSession = 1, //start entity session
- EndSession = 2, //end entity session
- Request = 3, //call request
- RequestAck = 4, //request acknowledge
- SessionAck = 5, //start session acknowledge
- Register = 6, //register entity event
- Unregister = 7, //unregister entity event
- Event = 8, //event message
- LogEventMsgType = 9, //log event
- LogWarnMsgType = 10, //log warn
- SetVarReq = 11, //set sysvar request
- SetVarAck = 12, //set sysvar response
- GetVarReq = 13, //get sysvar request
- GetVarAck = 14, //get sysvar response
- Broadcast = 15, //broadcast msg to other entity
- GetSession = 16, //chromium session info
- // 0x00 00 00 00 - 0x00 00 FF FF for web to binary, communicate with other entity
- // 0x00 01 00 00 - 0x00 01 FF FF for web to chromium
- WEB_CHROMIUM_MSG_BEGIN = 0x00010000,
- RegisterNotify = 0x00010001, //web register Notify Msg
- UnRegisterNotify, //web unregister Notify
- WEB_CHROMIUM_MSG_END = 0x0001FFFF,
- METHOD_SYSTEM_START = 0x2F0000,
- METHOD_SYSTEM_LOG_DEBUG,
- METHOD_SYSTEM_LOG_INFO,
- METHOD_SYSTEM_LOG_WARN,
- METHOD_SYSTEM_LOG_ERROR,
- METHOD_SYSTEM_DETAIL_LOG_DEBUG,
- METHOD_SYSTEM_DETAIL_LOG_INFO,
- METHOD_SYSTEM_DETAIL_LOG_WARN,
- METHOD_SYSTEM_DETAIL_LOG_ERROR,
- METHOD_SYSTEM_END = 0x2FFFFF,
- METHOD_BEIDOU_LOG = 0x3F0001,
- };
- #define PARAMLIST_HEAD "{e12a3dc0-3a0b-47c4-a8c3-75190a42ae68}"
- #define PKT_TYPE_CONTROL_LINKCONTEXT (1 << 31)
- typedef struct {
- char businessId[32]; //32
- char traceId[32]; //32
- char spanId[16]; //16
- char parentSpanId[16]; //16
- char timestamp[16]; //16
- int reservedControl;
- }link_context;
- //(1)鍙戠幇linux涓媔nline鏈夐棶棰橈紝鎵╁睍涓嶅紑锛?锛夊瓨鍦ㄥ畯瀹氫箟鎷兼帴鏃讹紝鍑虹幇闂��
- std::string GetMessageTypeString(int messageType);
- #endif
- /* log detail
- MessageType include:METHOD_SYSTEM_DETAIL_LOG_DEBUG(3080197), METHOD_SYSTEM_DETAIL_LOG_INFO, METHOD_SYSTEM_DETAIL_LOG_WARN, METHOD_SYSTEM_DETAIL_LOG_ERROR,
- {
- "messageType": 3080198,
- "EntityName": "postmanpostman",
- "ResultMsg": "for LogTest from postman",
- "LogType": "VTMWeb",
- "CostTime": 444,
- "ResultCode": "RTA444444",
- "LogCode": "ASDASSD",
- "API": "postman::test",
- "SourceType": "test.cpp",
- "BussID":"asdfafwerwqerqwerwerqwerwqerwerwqerwqerqwer",
- "TipMsg":"fjoawjerfownfojinwiqfneuiwnefionwfnewqionr",
- "BeginTime":123456,
- "EndTime":234567,
- "CmptId":"232323",
- "CmptName":"sldfoeofoefbo"
- }
- messageType must have
- EntityName must have, it mean your upload entityName
- ResultMsg must have, it means your log
- LogType Not necessarily needed, if it equals to User, means upload it as LOG_TYPE_USER, otherwise, upload as LOG_TYPE_SYSTEM
- CostTime Not necessarily needed, it means how much time used
- ResultCode Not necessarily needed, Commonly, filling it with error code.
- LogCode Not necessarily needed, Commonly, filling it such as QLR0402402Z00001
- API Not necessarily needed, current API which you are using
- SourceType Not necessarily needed, current file and line when the code is running
- BussID Not necessarily needed,like the beidou
- TipMsg Not necessarily needed,what the msg you desired to show when errors cause
- BegtinTime Not necessarily needed, begin Time
- EndTime Not necessarily needed, end Time
- CmptId Not necessarily needed
- CmptName Not necessarily needed
- */
- /*
- beidou
- */
|