-
Notifications
You must be signed in to change notification settings - Fork 99
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
feat: Add human readable date to logging formats #441
Conversation
Some linters are failing, is there an autoformatter I can run on the diff? |
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.
there are some magic number thatwe should define as constant
Yes, if you run |
All good suggestions, I implemented them. I'm fighting with the linter now. When I try and run:
I tried:
but only get unrecognized argument. I checked the LastTest.log but there is nothing there. How can I show the offending file/line? |
f00477e
to
52dcd6b
Compare
Try:
You can also look in |
What I meant with autoformatter is a tool, which will automatically change the format applying some standard stylesheet, so that the style conforms with the linters. I got the linter to output what it's doing with |
That's how I usually do it. I think you may be able to run |
52dcd6b
to
a007a9d
Compare
Alright, thank you for the comment. I fixed the linting issues. |
46bc8b0
to
efa8356
Compare
dcf9497
to
1618bf4
Compare
378734b
to
d606f70
Compare
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.
@Kaju-Bubanja can you add some test for this?
42d9c30
to
bc7df0a
Compare
I added some tests but I don't get why the zero time on the jenkins machine is |
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.
a couple of comments.
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.
tests are failing : rcutils.TestTimeFixture.test_rcutils_time_point_value_as_date_string
Yeah because of this. Not really my domain |
@Kaju-Bubanja i think we need to set timezone explicitly during this test? |
I checked tzinfo which says:
So it looks like the runner needs to add the TZ variable and ideally set it to UTC. I don't know how to do that or if I even have the rights to change the environment variables of the runner. It would be great to get this useful feature into ROS. But I think somebody with more knowledge and maybe access needs to help us get this going. |
b2319f2
to
fe7ea77
Compare
fe7ea77
to
c1e2b88
Compare
c1e2b88
to
1e147e9
Compare
I think it's ready @clalancette @fujitatomoya |
@Kaju-Bubanja thanks for the fix! CI: |
src/time.c
Outdated
time_t now_t = (time_t)(seconds); | ||
struct tm ptm = {.tm_year = 0, .tm_mday = 0}; | ||
#ifdef _WIN32 | ||
if (localtime_s(&now_t, &ptm) == NULL) { |
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.
getting closer but windows CI is still unhappy, see https://ci.ros2.org/job/ci_windows/21119/msbuild/new/
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.
Ofc win and Linux have source/dest switched around :D
1e147e9
to
247c9a5
Compare
@fujitatomoya Can I do that too, I wonder: CI: Ok, doesn't look like it, I thought maybe there is a bot which adds the labels when you write CI: |
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.
Besides the comment inline, Windows testing is failing in this code: https://ci.ros2.org/job/ci_windows/21127/testReport/junit/(root)/projectroot/test_time/
src/time.c
Outdated
time_t now_t = (time_t)(seconds); | ||
struct tm ptm = {.tm_year = 0, .tm_mday = 0}; | ||
#ifdef _WIN32 | ||
if (localtime_s(&ptm, &now_t) == NULL) { |
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.
MSVC is saying:
'==': 'errno_t' differs in levels of indirection from 'void *'
Indeed, looking up the documentation for localtime_s shows that it returns an errno_t
, not a pointer. So at least this needs to be fixed.
Signed-off-by: Kaju Bubanja <bubanja.kaju@gmail.com>
Signed-off-by: Kaju Bubanja <bubanja.kaju@gmail.com>
247c9a5
to
3ad9786
Compare
Can I see these jobs myself, so to not loop you in unecessarily each time I fixed something? Because the checks which are running below always show 3 successful checks. Are these CI runs manually run by you and you link to the results or are they automatically run? |
They are unfortunately run manually. |
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.
This looks good to me now. Thanks @Kaju-Bubanja for all of the iterations. @ahcorde you have the last remaining review, are you good with this now?
I'm going to go ahead with this one. Thanks @Kaju-Bubanja . |
Thank you guys, happy we got this useful feature into rolling :) |
* feat: Add human readable date to logging formats Signed-off-by: Kaju Bubanja <bubanja.kaju@gmail.com> Signed-off-by: Dave Rensberger <davidr@beechwoods.com>
* feat: Add human readable date to logging formats Signed-off-by: Kaju Bubanja <bubanja.kaju@gmail.com> Signed-off-by: Dave Rensberger <davidr@beechwoods.com>
This pull request has been mentioned on ROS Discourse. There might be relevant details there: https://discourse.ros.org/t/ros-2-jazzy-jalisco-released/37862/1 |
No description provided.