-
Notifications
You must be signed in to change notification settings - Fork 26
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
more granular timestamps in logs #129
Conversation
Codecov Report
@@ Coverage Diff @@
## master #129 +/- ##
==========================================
+ Coverage 67.66% 70.47% +2.81%
==========================================
Files 32 36 +4
Lines 1976 2544 +568
==========================================
+ Hits 1337 1793 +456
- Misses 570 654 +84
- Partials 69 97 +28
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
assert.Equal(t, str, "{\"__type\":\"A Question\",\"_name\":\"What's in a name?\",\"level\":\"info\",\"msg\":\"That which we call a rose by any other name would smell just as sweet.\",\"time\":\"0001-01-01T00:00:00Z\"}\n") | ||
|
||
assert.Equal(t, | ||
"{\"__type\":\"A Question\",\"_name\":\"What's in a name?\",\"level\":\"info\",\"msg\":\"That which we call a rose by any other name would smell just as sweet.\",\"time\":\"0001-01-01T00:00:00Z\"}\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interestingly, I'm NOT actually changing this test in any meaningful way. The unit test already assumed this format and the zero-value of the timestamp doesn't print out the sub-second info.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
conduit/data/config.go
Outdated
// Unfortunately, variations on this theme didn't work: | ||
// ConduitTimeFormat = "Mon, 02 Jan 2006 15:04:05.123456789 -0700" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^^^ just adding more decimal places didn't work ^^^
Summary
Change Conduit's formatter for a higher level of granularity to:
Caveat
Taken from: https://pkg.go.dev/time
Test Plan
CI