Skip to content

Conversation

@AlejandroFernandezLuces
Copy link
Contributor

@AlejandroFernandezLuces AlejandroFernandezLuces commented Aug 25, 2025

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.

@github-actions github-actions bot added the enhancement New features or code improvements label Aug 25, 2025
@github-actions github-actions bot added the testing Anything related to testing label Aug 25, 2025
@AlejandroFernandezLuces AlejandroFernandezLuces marked this pull request as ready for review August 25, 2025 10:02
Copy link
Member

@RobPasMue RobPasMue left a 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

Copy link

@ludovicsteinbach ludovicsteinbach left a 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

Copy link

@da1910 da1910 left a 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.

Copy link
Member

@RobPasMue RobPasMue left a 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)

@AlejandroFernandezLuces AlejandroFernandezLuces merged commit 14c7872 into main Oct 9, 2025
23 checks passed
@AlejandroFernandezLuces
Copy link
Contributor Author

Opened follow up issues in #42 and #43.

@AlejandroFernandezLuces AlejandroFernandezLuces deleted the feat/logger-formatter branch October 9, 2025 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New features or code improvements testing Anything related to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants