1
This commit is contained in:
parent
14ec983449
commit
d95756afcd
38
tglog.go
38
tglog.go
@ -73,6 +73,44 @@ func (this *tgLog) AddTrackLog(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *tgLog) AddCustomLog(
|
||||||
|
gameId int32,
|
||||||
|
accountId string,
|
||||||
|
distinctId string,
|
||||||
|
ip string,
|
||||||
|
eventName string,
|
||||||
|
prop map[string]interface{}) {
|
||||||
|
logObj := struct {
|
||||||
|
AccountId string `json:"#account_id"`
|
||||||
|
DistinctId string `json:"#distinct_id"`
|
||||||
|
Type string `json:"#type""`
|
||||||
|
Time string `json:"#time"`
|
||||||
|
Ip string `json:"#ip""`
|
||||||
|
EventName string `json:"#event_name""`
|
||||||
|
Properties map[string]interface{} `json:"properties"`
|
||||||
|
}{
|
||||||
|
AccountId: accountId,
|
||||||
|
DistinctId: distinctId,
|
||||||
|
Type: "track",
|
||||||
|
Time: q5.FormatUnixDateTime(_app.GetRealSeconds(), _app.GetLocation()),
|
||||||
|
EventName: eventName,
|
||||||
|
Ip: ip,
|
||||||
|
Properties: prop,
|
||||||
|
}
|
||||||
|
p := new(tgLogMsgNode)
|
||||||
|
p.gameId = gameId
|
||||||
|
p.jsonStr = q5.EncodeJson(logObj)
|
||||||
|
this.msgMutex.Lock()
|
||||||
|
defer this.msgMutex.Unlock()
|
||||||
|
if this.botNode != nil {
|
||||||
|
this.botNode.next = p
|
||||||
|
this.botNode = p
|
||||||
|
} else {
|
||||||
|
this.topNode = p
|
||||||
|
this.botNode = p
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (this *tgLog) goSaveToFile() {
|
func (this *tgLog) goSaveToFile() {
|
||||||
var workNode *tgLogMsgNode
|
var workNode *tgLogMsgNode
|
||||||
for {
|
for {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user