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

feat: aligns logger with caddy #50

Merged
merged 2 commits into from
Apr 24, 2023
Merged

feat: aligns logger with caddy #50

merged 2 commits into from
Apr 24, 2023

Conversation

jcchavezs
Copy link
Member

@jcchavezs jcchavezs commented Apr 1, 2023

This PR aligns the logger with the one provided by caddy (zap).

@sonarcloud
Copy link

sonarcloud bot commented Apr 1, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@jcchavezs jcchavezs changed the title Aligns logger feat: aligns logger with caddy Apr 1, 2023
@jcchavezs jcchavezs requested a review from M4tteoP April 1, 2023 17:04
return true
}

type noopEvent struct{}
Copy link
Member Author

Choose a reason for hiding this comment

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

In the end I think it is worth to export the noop event, maybe as a variable or just the constructor @anuraaga

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems this is because of the level check in this code - I wonder if level checks are supposed to happen at a higher level in coraza (these become just LogWriter or something). Maybe too much to change now.

Another option could be to delegate to noop logger, which is public, instead of returning noopEvent - what about that?

Copy link
Member Author

Choose a reason for hiding this comment

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

Checks will happen if we need to adapt logger with an underlying platform logger (in this case zap). I will leave this as it is now and if in the future we need the noop even to be exported we can export.

Copy link
Member

@fzipi fzipi left a comment

Choose a reason for hiding this comment

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

Excellent. Let's wait for @anuraaga's comment then, but for me this looks good.

@jcchavezs jcchavezs merged commit 3e85876 into master Apr 24, 2023
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.

3 participants