goatshriek / stumpless

a C logging library built for performance and features
https://goatshriek.github.io/stumpless
Apache License 2.0
446 stars 335 forks source link

Document Undocumented Functions in entry.h for Issue #371 #399

Closed Beorlor closed 9 months ago

Beorlor commented 9 months ago

This pull request addresses Issue #371 by providing documentation comments for previously undocumented functions in the include/private/entry.h file. The following functions now have comments detailing their purpose and behavior:

locked_get_element_by_name new_entry strbuilder_append_app_name strbuilder_append_hostname strbuilder_append_msgid strbuilder_append_message strbuilder_append_procid unchecked_destroy_entry unchecked_entry_has_element unlock_entry (Note: There's a relevant discussion left in the comments due to potential thread safety implications as discussed in Issue #136)

As my first ever contribution to an open-source project and pull request, I hope these changes will be beneficial and not waste your time. I have made an effort to ensure that each function is documented according to the project standards. There might be too much commits in this PR, reflecting each step of the documentation process.

Looking forward to feedback and suggestions.

Thank you.

codecov[bot] commented 9 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (b3a7a10) 90.48% compared to head (61dd81f) 90.48%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## latest #399 +/- ## ======================================= Coverage 90.48% 90.48% ======================================= Files 46 46 Lines 4160 4160 Branches 553 553 ======================================= Hits 3764 3764 Misses 273 273 Partials 123 123 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Beorlor commented 9 months ago

Sorry for the inconvenience, I've rebase the commit to signed them

goatshriek commented 9 months ago

No worries, and thank you for the contribution! I will find the time to sit down and review this in the next couple of days.

Beorlor commented 9 months ago

Thank you for your time and feedback. I have made the requested changes. I really enjoy working on this project and hope to continue contributing. I hope to be useful and am learning a lot by reviewing the project's code.

goatshriek commented 9 months ago

Also, don't worry about the CI failures - they are a codecov issue that can be fixed by re-running and aren't something you caused.

Beorlor commented 9 months ago

I've made further revisions to the unlock_entry function, incorporating my understanding of the config_unlock_mutex macro, which is why there are two commits. Initially uncertain about its operation, I now understand that it aligns differently depending on the system, clarifying its role in thread synchronization. I have updated the documentation accordingly and committed these changes. I hope this revision are fine.

Beorlor commented 9 months ago

For the lock_entry function that appear everywhere... It seems like my commit from another PC and then trying to sign it on my main one did something weird. My bad on that. Just fixed it up, so it should be all good now. Let me know if anything still looks off! Thanks for your patience

goatshriek commented 9 months ago

This is very close! Just one more minor adjustment to fix the static analysis: @since tags need to follow the format "release vx.x.x". The current versions you've added are missing the v prefix to the version.

Beorlor commented 9 months ago

Should be good now

goatshriek commented 9 months ago

Thank you very much for putting this together, and sticking with it through the requested changes!