fix(logs): enhance timestamp format to include timezone in logs

Signed-off-by: MayorFaj <mayorfaj@gmail.com>
This commit is contained in:
MayorFaj
2025-12-06 12:53:43 +00:00
committed by Matt Heon
parent dac1e82710
commit f111cedfce

View File

@@ -166,8 +166,8 @@ podman wait $CTRNAME
t GET "containers/${CTRNAME}/logs?timestamps=true&stdout=true" 200
# /logs returns application/octet-stream with binary headers. Strip null bytes.
# Verify timestamp format includes nanoseconds (LogTimeFormat with 9 zero-padded digits)
like "$(tr -d \\0 <$WORKDIR/curl.result.out)" ".*[0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}T[0-9]\\{2\\}:[0-9]\\{2\\}:[0-9]\\{2\\}\\.[0-9]\\{9\\}.*test message.*" \# Format: 2006-01-02T15:04:05.000000000Z07:00
# Timezone can be 'Z' (UTC) or '+/-HH:MM'
like "$(tr -d \\0 <$WORKDIR/curl.result.out)" ".*[0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}T[0-9]\\{2\\}:[0-9]\\{2\\}:[0-9]\\{2\\}\\.[0-9]\\{9\\}\\(Z\\|[+-][0-9]\\{2\\}:[0-9]\\{2\\}\\).*test message.*" \
"logs timestamps should include nanosecond precision"
podman rm -f $CTRNAME