From d74401be9a78637cd1c8f0e317b8391926237275 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Fri, 13 Nov 2020 18:42:23 -0700 Subject: [PATCH] Timestamps in event log --- CHANGELOG.md | 5 +++++ src/handlers.go | 2 +- src/instance.go | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d258cec..77bba84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [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 ### Added - Backport event logging from v4 diff --git a/src/handlers.go b/src/handlers.go index 9fbae14..1b16a48 100644 --- a/src/handlers.go +++ b/src/handlers.go @@ -98,7 +98,7 @@ func (ctx *Instance) registerHandler(w http.ResponseWriter, req *http.Request) { "Team registered", "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) { diff --git a/src/instance.go b/src/instance.go index 007d32c..8565d06 100644 --- a/src/instance.go +++ b/src/instance.go @@ -136,7 +136,8 @@ func (ctx *Instance) LogEvent(event, participantID, teamID, cat string, points i event = strings.ReplaceAll(event, " ", "-") msg := fmt.Sprintf( - "%s %s %s %s %d", + "%d %s %s %s %s %d", + time.Now().Unix(), logstr(event), logstr(participantID), logstr(teamID),