Skip to content

feat: colored logging formatter#348

Draft
ab93 wants to merge 1 commit intomainfrom
log-color
Draft

feat: colored logging formatter#348
ab93 wants to merge 1 commit intomainfrom
log-color

Conversation

@ab93
Copy link
Copy Markdown
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
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 17, 2024

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.39%. Comparing base (bf27eb5) to head (0e9ab0d).
⚠️ Report is 38 commits behind head on main.

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ab93 ab93 requested review from sarabala1979 and vigith February 17, 2024 00:29
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
Copy Markdown

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
Copy Markdown

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
Copy Markdown
Member

@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
Copy Markdown
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