(logs []*Log)
| 48 | ) |
| 49 | |
| 50 | func formatUserLogs(logs []*Log) { |
| 51 | for i := range logs { |
| 52 | logs[i].ChannelName = "" |
| 53 | var otherMap map[string]interface{} |
| 54 | otherMap, _ = common.StrToMap(logs[i].Other) |
| 55 | if otherMap != nil { |
| 56 | // delete admin |
| 57 | delete(otherMap, "admin_info") |
| 58 | } |
| 59 | logs[i].Other = common.MapToJsonStr(otherMap) |
| 60 | logs[i].Id = logs[i].Id % 1024 |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | func GetLogByKey(key string) (logs []*Log, err error) { |
| 65 | if os.Getenv("LOG_SQL_DSN") != "" { |
no test coverage detected