-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
RFC Multiline logging #4485
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
RFC Multiline logging #4485
Conversation
Codecov Report
@@ Coverage Diff @@
## features #4485 +/- ##
============================================
- Coverage 95.81% 95.77% -0.04%
============================================
Files 111 111
Lines 25038 25063 +25
Branches 2463 2468 +5
============================================
+ Hits 23989 24003 +14
- Misses 738 746 +8
- Partials 311 314 +3
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## features #4485 +/- ##
============================================
+ Coverage 95.74% 95.77% +0.02%
============================================
Files 111 111
Lines 24951 25063 +112
Branches 2459 2468 +9
============================================
+ Hits 23889 24003 +114
+ Misses 748 746 -2
Partials 314 314
Continue to review full report at Codecov.
|
Interesting. |
Also just having "E", "W", "I" etc might be worthwile - think about smaller screen, e.g. 80 chars. |
I like the idea about the short levelnames. However, colored short levelnames are currently not support by pytest, because the regex in the logging formatter does not support the levelname fmt '%(levelname).1s'. At work I use a custom fmt string because I don't like the default one.
Note the above one only looks good with a patched (support for single letter levelnames) pytest. |
d982dda
to
4c846c8
Compare
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.
If this lands, can it be optional?
I think we should rather make the current integration of the log formatter a bit more extensible. What I have in mind is that the default formatter should be easily replaceable by a custom log formatter. Ideally we could create a collection of predefined log formatters in a new pytest package that can then be selected by name. |
Even better then :) |
Hi @Thisch, It has been a long time since it has last seen activity, plus we have made sweeping changes on In order to clear up our queue and let us focus on the active PRs, I'm closing this PR for now. Please don't consider this a rejection of your PR, we just want to get this out of sight until you have the time to tackle this again. If you get around to work on this in the future, please don't hesitate in re-opening this! Thanks for your work, the team definitely appreciates it! |
This adds support for aligned multi-line log messages:
What this change is doing is inserting white-space to all lines except the first of the "message" part of the log msg.