-
Couldn't load subscription status.
- Fork 28
Timestamped logging macro for elapsed physical time #546
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
base: main
Are you sure you want to change the base?
Conversation
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 is a great start. Thanks! I left some suggestions.
|
Just to provide the context @adi-65-ray (Aditya Ray) is an M.S. student at ASU, and he kindly volunteered to fix this issue. This PR will be his very first contribution. |
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 is a nice feature to have, but there remain some subtleties. If we can resolve these, it might be nice to have this be part of the LF_PRINT_DEBUB macro rather than being a whole new macro.
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.
LGTM!
(Modulo getting the tests to pass)
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 PR is a fix for #395.
I have implemented a macro which prepends the physical lapsed time to debug messages
LF_TIMESTAMP_PRINT_DEBUGinlogging_macros.hI have also included a test code to test the functionality of the macro to check its expected output.
expected output:
DEBUG: Start time: -9223372036854775808
DEBUG: [-7464962496372149757] [Test case: 0]testing timed debug prints
DEBUG: [-7464962491372064629] [Test case: 1]testing timed debug prints
DEBUG: [-7464962486371771465] [Test case: 2]testing timed debug prints
DEBUG: [-7464962481371438023] [Test case: 3]testing timed debug prints
DEBUG: [-7464962476371116940] [Test case: 4]testing timed debug prints
DEBUG: [-7464962471370813344] [Test case: 5]testing timed debug prints
DEBUG: [-7464962466370645568] [Test case: 6]testing timed debug prints
DEBUG: [-7464962461370410362] [Test case: 7]testing timed debug prints
DEBUG: [-7464962456370065744] [Test case: 8]testing timed debug prints
DEBUG: [-7464962451369754731] [Test case: 9]testing timed debug prints