Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

feat(log): colorful logs for stdlib logging #242

Merged
merged 4 commits into from
Jan 14, 2023
Merged

Conversation

gazorby
Copy link
Collaborator

@gazorby gazorby commented Jan 13, 2023

Enable colorful logs when using python's logging module, logging should be more uniform wether stdlib or structlog is used:

Screenshot 2023-01-13 155144

@gazorby
Copy link
Collaborator Author

gazorby commented Jan 13, 2023

Json logging:

image

Copy link
Member

@peterschutt peterschutt left a comment

Choose a reason for hiding this comment

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

I added a processor to remove that color_message key that comes out of uvicorn.

LMK what you think, but otherwise looks great! Thanks!

A processor class that allows specific keys to be filtered from a log
event.

Applies the filter to our default processor chain to remove the
"color_message" key that is injected into extras by uvicorn.
@sonarqubecloud
Copy link

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 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@gazorby
Copy link
Collaborator Author

gazorby commented Jan 14, 2023

Nice @peterschutt!, LGTM ;)

@peterschutt peterschutt merged commit ca2ce6f into main Jan 14, 2023
@peterschutt peterschutt deleted the stdlib-colorful-logs branch January 14, 2023 07:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants