MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / RecordLog

Function RecordLog

model/log.go:78–94  ·  view source on GitHub ↗
(userId int, logType int, content string)

Source from the content-addressed store, hash-verified

76}
77
78func RecordLog(userId int, logType int, content string) {
79 if logType == LogTypeConsume && !common.LogConsumeEnabled {
80 return
81 }
82 username, _ := GetUsernameById(userId, false)
83 log := &Log{
84 UserId: userId,
85 Username: username,
86 CreatedAt: common.GetTimestamp(),
87 Type: logType,
88 Content: content,
89 }
90 err := LOG_DB.Create(log).Error
91 if err != nil {
92 common.SysError("failed to record log: " + err.Error())
93 }
94}
95
96func RecordErrorLog(c *gin.Context, userId int, channelId int, modelName string, tokenName string, content string, tokenId int, useTimeSeconds int,
97 isStream bool, group string, other map[string]interface{}) {

Callers 8

EpayNotifyFunction · 0.92
updateVideoSingleTaskFunction · 0.92
UpdateMidjourneyTaskBulkFunction · 0.92
updateSunoTaskAllFunction · 0.92
UpdateUserFunction · 0.92
RechargeFunction · 0.85
RedeemFunction · 0.85
InsertMethod · 0.85

Calls 4

GetTimestampFunction · 0.92
SysErrorFunction · 0.92
GetUsernameByIdFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected