日志优化
This commit is contained in:
parent
892b6408d3
commit
94a056c18a
@ -1,6 +1,7 @@
|
||||
package thinkingdata
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"sync"
|
||||
"time"
|
||||
@ -36,6 +37,7 @@ type Data struct {
|
||||
UUID string `json:"#uuid,omitempty"`
|
||||
AppId string `json:"#app_id,omitempty"`
|
||||
Properties map[string]interface{} `json:"properties"`
|
||||
PropertiesSummary string `json:"properties_summary,omitempty"`
|
||||
}
|
||||
|
||||
// TDConsumer define operation interface
|
||||
@ -275,7 +277,10 @@ func (ta *TDAnalytics) add(accountId, distinctId, dataType, eventName, eventId s
|
||||
if len(uuid) == 0 {
|
||||
uuid = generateUUID()
|
||||
}
|
||||
|
||||
properties_summary, err := json.Marshal(properties)
|
||||
if err != nil {
|
||||
properties_summary = []byte{}
|
||||
}
|
||||
data := Data{
|
||||
AccountId: accountId,
|
||||
DistinctId: distinctId,
|
||||
@ -288,13 +293,14 @@ func (ta *TDAnalytics) add(accountId, distinctId, dataType, eventName, eventId s
|
||||
Ip: ip,
|
||||
UUID: uuid,
|
||||
Properties: properties,
|
||||
PropertiesSummary: string(properties_summary),
|
||||
}
|
||||
|
||||
if len(appId) > 0 {
|
||||
data.AppId = appId
|
||||
}
|
||||
|
||||
err := formatProperties(&data, ta)
|
||||
err = formatProperties(&data, ta)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user