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: colored logging formatter #348

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

feat: colored logging formatter #348

wants to merge 1 commit into from

Conversation

ab93
Copy link
Member

@ab93 ab93 commented Feb 17, 2024

  • Add colored logging for udfs
  • remove unused dependencies
  • update dockerfile
image

closes #312

Signed-off-by: Avik Basu <ab93@users.noreply.github.com>
@ab93 ab93 self-assigned this Feb 17, 2024
@ab93 ab93 added the enhancement New feature or request label Feb 17, 2024
@ab93 ab93 marked this pull request as ready for review February 17, 2024 00:22
Copy link

codecov bot commented Feb 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (bf27eb5) 92.31% compared to head (0e9ab0d) 92.39%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #348      +/-   ##
==========================================
+ Coverage   92.31%   92.39%   +0.07%     
==========================================
  Files          82       82              
  Lines        3918     3931      +13     
  Branches      325      325              
==========================================
+ Hits         3617     3632      +15     
+ Misses        233      230       -3     
- Partials       68       69       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

super().__init__(*args, **kwargs)
self._formats = {
logging.DEBUG: f"{self.BLUE}{self._fmt}{self.RESET}",
logging.INFO: f"{self.WHITE}{self._fmt}{self.RESET}",
Copy link

Choose a reason for hiding this comment

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

Do we ensure that the text background won't be WHITE as well?

}

def format(self, record):
self._style._fmt = self._formats.get(record.levelno)
Copy link

Choose a reason for hiding this comment

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

Do we need to prepare for the case when a new / typo logging level is introduced?

Copy link
Collaborator

@vigith vigith left a comment

Choose a reason for hiding this comment

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

how do we turn this on/off? it looks like it is always on, and this ("ANSI Escape Codes") might not work everywhere.

@s0nicboOm
Copy link
Contributor

s0nicboOm commented Feb 18, 2024

ANSI Escape Codes

I think we should add this switch. Apparently windows OS also have problem with colors. I remember that "loguru" added external library called "colorama" to solve for Windows.

@ab93 ab93 marked this pull request as draft April 21, 2024 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add "color" to the logging based on logging level
4 participants