1
This commit is contained in:
parent
03df640b48
commit
14ec983449
13
tglog.go
13
tglog.go
@ -38,22 +38,25 @@ func (this *tgLog) SetPolyLog(isPolyLog bool) {
|
|||||||
func (this *tgLog) AddTrackLog(
|
func (this *tgLog) AddTrackLog(
|
||||||
gameId int32,
|
gameId int32,
|
||||||
accountId string,
|
accountId string,
|
||||||
remoteAddr string,
|
distinctId string,
|
||||||
|
ip string,
|
||||||
eventName string,
|
eventName string,
|
||||||
prop map[string]string) {
|
prop map[string]string) {
|
||||||
logObj := struct {
|
logObj := struct {
|
||||||
AccountId string `json:"#account_id"`
|
AccountId string `json:"#account_id"`
|
||||||
|
DistinctId string `json:"#distinct_id"`
|
||||||
Type string `json:"#type""`
|
Type string `json:"#type""`
|
||||||
Time string `json:"#time"`
|
Time string `json:"#time"`
|
||||||
EventName string `json:"#event_name""`
|
|
||||||
Ip string `json:"#ip""`
|
Ip string `json:"#ip""`
|
||||||
|
EventName string `json:"#event_name""`
|
||||||
Properties map[string]string `json:"properties"`
|
Properties map[string]string `json:"properties"`
|
||||||
}{
|
}{
|
||||||
AccountId: accountId,
|
AccountId: accountId,
|
||||||
|
DistinctId: distinctId,
|
||||||
Type: "track",
|
Type: "track",
|
||||||
Time: q5.FormatUnixDateTime(_app.GetNowSeconds(), _app.GetLocation()),
|
Time: q5.FormatUnixDateTime(_app.GetRealSeconds(), _app.GetLocation()),
|
||||||
EventName: eventName,
|
EventName: eventName,
|
||||||
Ip: remoteAddr,
|
Ip: ip,
|
||||||
Properties: prop,
|
Properties: prop,
|
||||||
}
|
}
|
||||||
p := new(tgLogMsgNode)
|
p := new(tgLogMsgNode)
|
||||||
@ -99,7 +102,7 @@ func (this *tgLog) goSaveToFile() {
|
|||||||
func (this *tgLog) getLogFile(gameId int32) *os.File {
|
func (this *tgLog) getLogFile(gameId int32) *os.File {
|
||||||
fileName := fmt.Sprintf(TGLOG_FILENAME,
|
fileName := fmt.Sprintf(TGLOG_FILENAME,
|
||||||
os.Getpid(),
|
os.Getpid(),
|
||||||
q5.FormatUnixDateEx(_app.GetNowSeconds(), _app.GetLocation()))
|
q5.FormatUnixDateEx(_app.GetRealSeconds(), _app.GetLocation()))
|
||||||
logDir := ""
|
logDir := ""
|
||||||
if this.isPolyLog {
|
if this.isPolyLog {
|
||||||
logDir = fmt.Sprintf(POLY_TGLOG_ROOT, _app.GetPkgName(), gameId)
|
logDir = fmt.Sprintf(POLY_TGLOG_ROOT, _app.GetPkgName(), gameId)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user