Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions backend/wireguard/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import (
type logSeverity string

const (
wireGuardLogTimestampFormat = "2006/01/02 15:04:05.000000"
wireGuardLogTimestampFormat = "2006/01/02 15:04:05"

logSeverityInfo logSeverity = "Info"
logSeverityWarning logSeverity = "Warning"
logSeverityError logSeverity = "Error"
)

func formatWireGuardLogLine(severity logSeverity, message string) string {
timestamp := time.Now().Format(wireGuardLogTimestampFormat)
timestamp := time.Now().UTC().Format(wireGuardLogTimestampFormat)
return fmt.Sprintf("%s [%s] %s", timestamp, severity, message)
}

Expand Down
2 changes: 1 addition & 1 deletion backend/wireguard/wireguard_lifecycle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func TestWireGuardNewInitializesWithSingleConfigureCallIncludingPeers(t *testing

select {
case startupLog := <-wg.Logs():
pattern := regexp.MustCompile(`^\d{4}/\d{2}/\d{2} \d{2}:\d{2}:\d{2}\.\d{6} \[Info\] WireGuard interface wg-test initialized successfully$`)
pattern := regexp.MustCompile(`^\d{4}/\d{2}/\d{2} \d{2}:\d{2}:\d{2} \[Info\] WireGuard interface wg-test initialized successfully$`)
if !pattern.MatchString(startupLog) {
t.Fatalf("expected startup log with timestamp prefix, got %q", startupLog)
}
Expand Down