Skip to content
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

Allow debug output to be delivered via callbacks #1544

Merged
merged 1 commit into from
Sep 6, 2023

Conversation

paulej
Copy link
Collaborator

@paulej paulej commented Sep 1, 2023

These changes allow both normal debug logging and debug_dump() output to be delivered to the application via callback functions. This is useful so that debug output can be seamlessly integrated with other logging output. The changes allow the user to specify either a logging stream or callback function, but not both. (I did not see a use case for allowing delivery of messages to two places, but I have no objection to it.)

@paulej paulej requested a review from huitema September 1, 2023 02:24
Copy link
Collaborator

@huitema huitema left a comment

Choose a reason for hiding this comment

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

Looks good, but please fix the warning in appveyor:

       "C:\projects\picoquic\picoquic.sln" (default target) (1) ->
       "C:\projects\picoquic\picoquic\picoquic.vcxproj" (default target) (2) ->
       (ClCompile target) -> 
         c:\projects\picoquic\picoquic\util.c(168): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data [C:\projects\picoquic\picoquic\picoquic.vcxproj]
         c:\projects\picoquic\picoquic\util.c(172): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data 

@paulej
Copy link
Collaborator Author

paulej commented Sep 1, 2023

@huitema Thanks for pointing that out. I fixed that issue, as requested.

@paulej
Copy link
Collaborator Author

paulej commented Sep 1, 2023

Actually, I don't like where I defined mlen. I moved it.

Copy link
Collaborator

@huitema huitema left a comment

Choose a reason for hiding this comment

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

Looks good.

@huitema huitema merged commit 9890e02 into master Sep 6, 2023
8 checks passed
@paulej paulej deleted the paulej_logging_callback branch October 24, 2023 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants