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

Introduce log.h to decouple serverLog from server.h. #664

Closed
wants to merge 2 commits into from

Conversation

lipzhu
Copy link
Contributor

@lipzhu lipzhu commented Jun 18, 2024

Follow up of #599 (comment)

Copy link

codecov bot commented Jun 18, 2024

Codecov Report

Attention: Patch coverage is 85.00000% with 9 lines in your changes missing coverage. Please review.

Project coverage is 70.20%. Comparing base (a2cc2fe) to head (9198234).

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable     #664      +/-   ##
============================================
- Coverage     70.20%   70.20%   -0.01%     
============================================
  Files           110      111       +1     
  Lines         60078    60071       -7     
============================================
- Hits          42179    42172       -7     
  Misses        17899    17899              
Files Coverage Δ
src/server.c 88.57% <ø> (+0.03%) ⬆️
src/server.h 100.00% <ø> (ø)
src/log.c 85.00% <85.00%> (ø)

... and 9 files with indirect coverage changes

Signed-off-by: Lipeng Zhu <[email protected]>

#define serverLogRaw(level, ...) \
do { \
if (((level) & 0xff) < server.verbosity) break; \
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (((level) & 0xff) < server.verbosity) break; \
if (((level) & 0xff) < server.verbosity) break; \

This feels a bit like fake decoupling, since you can't import log.h without server.h, since we are accessing the server structure here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, the existing log implementation seems relied server and server config too much, its not straightforward to split it from server.h. Let's open an issue to discuss the code refactor work.

@lipzhu
Copy link
Contributor Author

lipzhu commented Jun 19, 2024

I saw @PingXie already opened a similar issue #656. Close this PR.

@lipzhu lipzhu closed this Jun 19, 2024
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