Skip to content

Conversation

@adi-65-ray
Copy link
Collaborator

This PR is a fix for #395.

I have implemented a macro which prepends the physical lapsed time to debug messages
LF_TIMESTAMP_PRINT_DEBUG in logging_macros.h
I 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

@hokeun hokeun marked this pull request as ready for review September 22, 2025 17:50
@hokeun hokeun self-requested a review September 22, 2025 17:50
Copy link
Member

@hokeun hokeun left a 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.

@hokeun hokeun requested a review from edwardalee September 22, 2025 17:57
@hokeun
Copy link
Member

hokeun commented Sep 22, 2025

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.

Copy link
Contributor

@edwardalee edwardalee left a 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.

Copy link
Contributor

@edwardalee edwardalee left a 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)

@hokeun hokeun changed the title Timestamped logging macro Timestamped logging macro for elapsed physical time Sep 28, 2025
@hokeun hokeun linked an issue Sep 28, 2025 that may be closed by this pull request
@hokeun hokeun added the enhancement Enhancement of existing feature label Sep 28, 2025
@hokeun hokeun requested a review from Jakio815 October 14, 2025 19:18
Copy link
Member

@hokeun hokeun left a comment

Choose a reason for hiding this comment

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

👍

@adi-65-ray adi-65-ray requested a review from hokeun October 22, 2025 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Enhancement of existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prepend logging prints with the current/elapsed physical time

3 participants