Timestamps in event log

This commit is contained in:
Neale Pickett 2020-11-13 18:42:23 -07:00
parent bbd19d0e19
commit d74401be9a
3 changed files with 8 additions and 2 deletions

View File

@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
## [v3.6.1] - 2020-11-13
### Fixed
- Timestamps on event log entries
- Team names logged in event log on registration
## [v3.6.0] - 2020-11-11 ## [v3.6.0] - 2020-11-11
### Added ### Added
- Backport event logging from v4 - Backport event logging from v4

View File

@ -98,7 +98,7 @@ func (ctx *Instance) registerHandler(w http.ResponseWriter, req *http.Request) {
"Team registered", "Team registered",
"Your team has been named and you may begin using your team ID!", "Your team has been named and you may begin using your team ID!",
) )
ctx.LogEvent("register", req.FormValue("pid"), teamId, "", 0) ctx.LogEvent("register", req.FormValue("pid"), teamId, "", 0, teamName)
} }
func (ctx *Instance) answerHandler(w http.ResponseWriter, req *http.Request) { func (ctx *Instance) answerHandler(w http.ResponseWriter, req *http.Request) {

View File

@ -136,7 +136,8 @@ func (ctx *Instance) LogEvent(event, participantID, teamID, cat string, points i
event = strings.ReplaceAll(event, " ", "-") event = strings.ReplaceAll(event, " ", "-")
msg := fmt.Sprintf( msg := fmt.Sprintf(
"%s %s %s %s %d", "%d %s %s %s %s %d",
time.Now().Unix(),
logstr(event), logstr(event),
logstr(participantID), logstr(participantID),
logstr(teamID), logstr(teamID),