Fix regression in timestamp resolution

Historic capnslog timestamps are in microsecond resolution. We need to match that when we migrate to the zap logger.

Signed-off-by: James Blair <mail@jamesblair.net>
This commit is contained in:
James Blair
2023-02-03 21:45:45 +13:00
parent 238da4b3f5
commit b9568dba32
2 changed files with 16 additions and 10 deletions

View File

@@ -56,7 +56,7 @@ func TestServerJsonLogging(t *testing.T) {
if entry.Timestamp == "" {
t.Errorf(`Missing "ts" key, line: %s`, line)
}
if _, err := time.Parse("2006-01-02T15:04:05.000Z0700", entry.Timestamp); entry.Timestamp != "" && err != nil {
if _, err := time.Parse("2006-01-02T15:04:05.999999Z0700", entry.Timestamp); entry.Timestamp != "" && err != nil {
t.Errorf(`Unexpected "ts" key format, err: %s`, err)
}
if entry.Caller == "" {