-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Provide logger formatter separately #37
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
Conversation
…rnal/ansys-tools-common into feat/logger-formatter
RobPasMue
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small comment on my side - LGTM otherwise
ludovicsteinbach
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe exposing the formatter in the right thing to do. I have added a couple comments on mutability
da1910
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is definitely better than the first proposal, but I'm not entirely convinced still.
Overall I think agreeing on a common order for log items is well worthwhile, likewise agreeing on what each level means. Going further, I'd advocate for ideally picking a structured logging format (structlog for example), or rolling our own, since that will make observability a lot easier overall.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's merge this for now and open follow up issues to try and address potential new cases (like @da1910's last comment)
Overview
After discussion, let's move forward to provide the formatter separately and not enforce the use of the singleton.
The singleton is kept since I think mostly tooling libraries can seize it.
Implementation details
As title says. I separated the formatter from the logger to avoid loading the singleton every time. Testing should be already covered by logger tests.