-
-
Notifications
You must be signed in to change notification settings - Fork 398
Added --timestamp
option to monitor command.
#2336
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
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #2336 +/- ##
==========================================
+ Coverage 63.03% 63.04% +0.01%
==========================================
Files 201 201
Lines 19264 19286 +22
==========================================
+ Hits 12143 12159 +16
- Misses 6067 6072 +5
- Partials 1054 1055 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
👋 Thank you, for the contribution. The implementation looks good. 🤩 The idea is to test only the
Don't forget to run If you need help don't hesitate to ping me I'd be more than happy to guide you. 💪 |
Thanks for the pointers, I'll add a test like you described. |
73b87c1
to
a30a158
Compare
Test added and formatting fixed. |
Oops, fixed that last formatting issue. |
--timestamp
option to monitor command.
Please check if the PR fulfills these requirements
before creating one)
our contributing guidelines
What kind of change does this PR introduce?
New feature in the monitor that can add a timestamp to the beginning of each received line.
What is the current behavior?
No such option.
What is the new behavior?
When
--timestamp
is provided, the monitor wraps the output tty with a timestamping Writer. The format of the timestamps isYYYY-mm-dd HH:MM:SS
.Does this PR introduce a breaking change, and is titled accordingly?
Negative.
Other information
This is my first time writing Go (except for the sample program I used to work out the approach), so please review carefully.
There don't appear to be any docs specifically about the monitor command, nor tests of the CLI entry point.
The change was tested by hand using this sketch:
Testing confirmed that individual non-newline characters received are still output immediately, and only newline characters cause the timestamp output: