Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

30 support asctime field for timestamp #139

Merged

Conversation

KevRiver
Copy link
Contributor

@KevRiver KevRiver commented Dec 9, 2024

No description provided.

@@ -153,3 +154,26 @@ func TestJSONHandler_UnmarshalJSON_ParsesCustomMultiNestedFields(t *testing.T) {
t.Fatalf("not equal: expected %q, got %q", tm, h.Time)
}
}

func TestParseAsctimeFields_1(t *testing.T) {
raw := []byte(`{"asctime": ["12-05-05 22:11:08,506248"]}`)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe pull these in a table-test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an issue with asctime since it doesn't include timezone information. For now, my implementation assumes the parsed time is in UTC, this assumption may be incorrect depending on the user application's logging configuration.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's a config value for this on the config struct 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see

@aybabtme aybabtme merged commit b71cae5 into humanlogio:master Dec 11, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants