-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
implementing AbstractAsyncAccessLogger #3767
Conversation
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.
Looks good!
Codecov Report
@@ Coverage Diff @@
## master #3767 +/- ##
==========================================
+ Coverage 97.94% 97.95% +<.01%
==========================================
Files 43 43
Lines 8576 8589 +13
Branches 1374 1375 +1
==========================================
+ Hits 8400 8413 +13
Misses 74 74
Partials 102 102
Continue to review full report at Codecov.
|
Is the PR ready for review? |
Yes |
@@ -164,8 +189,11 @@ def __init__(self, manager: 'Server', *, | |||
self.debug = debug | |||
self.access_log = access_log | |||
if access_log: | |||
self.access_logger = access_log_class( | |||
access_log, access_log_format) # type: Optional[AbstractAccessLogger] # noqa | |||
if issubclass(access_log_class, AbstractAsyncAccessLogger): |
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.
web_protocol.RequestHandler
is a private class, a part of implementation details.
Would you consider moving access log initialization into web.Server
/web.Application
.
RequestHandler.__init__
signature can be changed in a wild, e.g. replacement all access_log_class
, access_log
, access_log_format
with access logger instance is totally accepted.
I still have no clear vision of how exactly it should look like, and probably cannot have without prototyping.
If you want to play with the idea -- let me know.
Othervise the PR looks good to me.
I'm going to merge the PR as is. |
Thanks, @samuelcolvin |
I (partially) understand your concerns here but I'm still not clear what the new interface should be. Personally I think custom loggers should take |
I'm preparing an issue with a better description. |
See #3795 |
Continuation from #3557, needs tests and docs.
@asvetlov I guess this is what you mean?
Checklist
CONTRIBUTORS.txt
CHANGES
folder<issue_id>.<type>
for example (588.bugfix)issue_id
change it to the pr id after creating the pr.feature
: Signifying a new feature..bugfix
: Signifying a bug fix..doc
: Signifying a documentation improvement..removal
: Signifying a deprecation or removal of public API..misc
: A ticket has been closed, but it is not of interest to users.