-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Switch from using a homegrown logging solution to the stdlib logging module #2008
Conversation
e65d64e
to
e096de0
Compare
Hey @pfmoore, could I bother you to pull this on Windows and make sure it doesn't break anything? I don't think it should but I'm having problems getting a Windows environment set up correctly. |
af07d6b
to
9fcb459
Compare
@dstufft I grabbed the branch and did some basic tests (install, uninstall, search) and provoked a few errors (package not found, only external versions available). No problems with any of that. One point. The "Some externally hosted files were ignored as access to them may be unreliable" message is no longer shown with New version:
current develop version:
|
If there's anything else specifically you'd like me to test, let me know. |
Ah yes, the cdecimal thing was because I wasn't sure if I guess |
And no, nothing specific, I just wanted to make sure I didn't break anything on Windows. I didn't think there would be any changes that would break anything there. |
Oh, and the debug log message, maybe I should still print that message hmm. Historically the old debug log was overwritten with the entire log stream anytime the pip command failed. I've changed that in this PR so that it's always written, no matter what and it will rotate itself once it gets 10MB in size. So now there is always a log and it's not just special to failures. |
The log bit seems fine, I probably should have read the doc changes ;-) |
If #2012 ends up looking good, I'd presume the easiest course of action might be to merge that before this and then rebase this on top of it, as it touches |
Technically this obsoletes #2012, but 2012 has tests that I haven't written yet so I'm fine with that. |
1b09be9
to
c67d07c
Compare
d6b1cd5
to
0966b84
Compare
0966b84
to
07795f6
Compare
07795f6
to
767d11e
Compare
Switch from using a homegrown logging solution to the stdlib logging module
Use stdlib logger in newer versions of pip See pypa/pip#2008 for details
Overview
This PR switches us away from using our own custom logging framework and instead uses a combination of the stdlib logging and the warnings module. This will ideally give us a few benefits:
Details
logger
module that comes fromlogging.getLogger(__name__)
instead of a global one atpip.log:logger
.DEBUG
,INFO
,WARNING
,ERROR
,CRITICAL
. By default we'll logINFO
and higher, while any--quiet
configuration will change that toERROR
and higher, and any--verbose
will change that toDEBUG
and higher. The difference betweenERROR
andCRITICAL
is thatCRITICAL
should generally only be used for fatal errors.logger.deprecated()
deprecations will now be handled by usingwarnings.warn()
with special warnings from thepip.utils.deprecation
module.logging.config.dictConfig
from Python 2.7 for use in Python 2.6.Tasks
--verbose
and--quiet
flags.Fixed/Closed/Obsoleted Tickets
Closes #1943
Closes #1936
Closes #1772
Closes #1717
Closes #1629
Closes #1865
Closes #1826
Closes #1766
Closes #1713
Closes #1501
Closes #915