summaryrefslogtreecommitdiff
path: root/src/pip/_internal/utils/logging.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix types for logging Rich objectsPradyun Gedam2022-05-221-3/+5
|
* Rename `[present-diagnostic]` to `[present-rich]`Pradyun Gedam2022-04-221-5/+6
| | | | | | This makes it more reasonable to use a rich renderable for regular logging messages, instead of only using it for the diagnostic error messages.
* Replace Iterator[T] with Generator[T,None, None] (#11007)q0w2022-04-091-2/+2
| | | Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
* Update pre-commit hooksHenrich Hartzer2022-04-041-3/+5
| | | | Co-Authored-By: q0w <43147888+q0w@users.noreply.github.com>
* Pacify unit testsPradyun Gedam2022-01-251-1/+1
|
* Apply suggestions from code reviewPradyun Gedam2021-12-121-1/+1
| | | Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* Restore colors in regular logging messagesPradyun Gedam2021-12-121-3/+11
| | | | | Also, reflects that `--no-color` does not mean no-ansi-escapes but only affects colour rules.
* Enable the use of rich for presenting outputPradyun Gedam2021-12-121-88/+65
| | | | | | | | | | This makes it possible to present output with rich markup, within the constraints of our logging infrastructure. Further, diagnostic errors can now by presented using rich, using their own special "[present-diagnostic]" marker string, since those need to be handled differently from regular log messages and passed directly through to rich's console object, after an indentation wrapper.
* Simplify `_is_broken_pipe_error` definitionPradyun Gedam2021-09-031-25/+7
| | | | | | | The different-definition-based-on-platform is unnecesary. This isn't called such that the cost of an additional conditional matters much. Bundling it into a single function definition makes it easier to read.
* Move many type comments to annotationsJon Dufresne2021-08-101-41/+26
| | | | | | | | | | Use the tool com2ann to automatically convert most type comments to type annotations. Some type comments continue to exist where any work beyond the automatic conversion was required (for example, additional formatting or circular references). For additional information on the com2ann tool, see: https://github.com/ilevkivskyi/com2ann
* Use UTF-8 for log fileInada Naoki2021-06-161-0/+1
|
* use setLoggerClass to define log.verboseMin RK2021-06-111-7/+2
| | | | | | | loaded in pip._internals.__init__ must use utils.logging.getLogger to get the right type annotation instead of logging.getLogger, despite no actual difference in behavior
* -v shows subprocess outputMin RK2021-03-121-7/+15
| | | | | | | | adds VERBOSE custom log level between DEBUG and INFO used when `-v` is given. Now require -vv to enable full debug output. Messages can be logged with VERBOSE level to promote them to `-v` output instead of `-vv`
* Use super() for Python 2 old-style classesJon Dufresne2021-02-231-2/+2
| | | | Followup to c148bcc1aa4025a9dae5bcdabe1a1e01e6df28e5.
* Handle several mypy TODO comments and exceptionsJon Dufresne2021-02-221-7/+28
| | | | Remove mypy exceptions that are straightforward to remove.
* Blacken src/pip/_internal/utils directoryJon Dufresne2021-02-211-89/+86
|
* Remove typing.TYPE_CHECKING guardsJon Dufresne2021-02-191-4/+1
| | | | | | | | | | | The typing module has been available since Python 3.5. Guarding the import has been unnecessary since dropping Python 2. Some guards remain to either: - Avoid circular imports - Importing objects that are also guarded by typing.TYPE_CHECKING - Avoid mypy_extensions dependency
* Replace pip._internal.utils.typing with stdlib typingJon Dufresne2021-02-181-2/+2
| | | | | | | | The stdlib module has been available since Python 3.5 and the TYPE_CHECKING constant has been available since 3.5.2. By using stdlib, this removes the need for pip to maintain its own Python 2 typing compatibility shim.
* Use keyword-only argumentsJon Dufresne2021-01-291-2/+12
| | | | | | | | | | | | | | | | | | | https://www.python.org/dev/peps/pep-3102/ Replaces the pattern: self.name = kwargs.pop('name') Keyword-only arguments offer some advantages: - In the event of a typo or misuse, a more informative error is presented to the programmer. - More self documenting and makes interfaces more explicit. - They more easily allow explicit typing. Adding types to ConfigOptionParser required changing some call sites to pass arguments without using a dict due to mypy bug: https://github.com/python/mypy/issues/9676
* Merge pull request #9367 from hugovk/rm-2-default_time_formatXavier Fernandez2021-01-131-3/+2
|\ | | | | Use Formatter.default_time_format after dropping PY2
| * Use Formatter.default_time_format after dropping PY2Hugo van Kemenade2020-12-271-3/+2
| |
* | Remove unnecessary "noqa" commentsJon Dufresne2020-12-281-2/+2
| |
* | Remove outdated mypy workaround for colorama importJon Dufresne2020-12-271-23/+3
|/
* Use short Python3 super() syntaxJon Dufresne2020-12-241-5/+5
|
* Remove __future__ importsJon Dufresne2020-12-241-2/+0
| | | | Unnecessary since dropping Python 2.
* Remove redundant Python 2.7 codeHugo van Kemenade2020-12-221-20/+6
|
* Delete misleading line of codeNikolay Korolev2020-04-121-1/+0
|
* Make indent_log thread-safeNikolay Korolev2020-04-021-0/+2
|
* Convert the remaining '%' formatters to '.format'. Fixes #6973.Jason R. Coombs2020-03-061-1/+1
|
* Remove dependency of utils.logging on utils.suprocessPradyun Gedam2019-09-301-2/+2
|
* Update all the imports as neededPradyun Gedam2019-09-301-1/+2
|
* add per-file disallow_untyped_defs=False, and set it to True globallyMaxim Kurnikov2019-09-291-0/+3
|
* Remove strict_optional=False for utils/logging.py.Chris Jerdonek2019-07-141-3/+23
|
* Add milliseconds to --log entry timestamps. (#6621)Christopher Hunt2019-06-171-3/+6
| | | | Resolves #6587.
* Prevent subprocess stdout and stderr from cluttering pip's stdout.Chris Jerdonek2019-03-251-6/+39
|
* Prefix warning and error log messages.Chris Jerdonek2019-02-271-1/+21
|
* Use the requested log level when handling broken stdout pipe.Chris Jerdonek2019-01-211-0/+6
|
* Unskip / get the end-to-end tests working for Windows.Chris Jerdonek2019-01-201-6/+24
|
* Handle BrokenPipeError gracefully.Chris Jerdonek2019-01-201-0/+44
|
* Add failing tests.Chris Jerdonek2019-01-201-0/+7
|
* Prefix user_log (--log) entries with timestamp (#6142)Ami Fischman2019-01-201-3/+21
| | | | | | | | | | | | | | Why? Eases post-facto analysis of time spent in different phases of pip operation. Historical note: https://github.com/pypa/pip/commit/767d11e49cb916e2d4637421d524efcb8d02ae8d#diff-b670e3b192038c9ffe810c1a12c0c51fL219 made it so that pip invocations emit zero timestamp information to the log file. Prior to that each pip invocation's start time was written out (search that commit's diff for [strftime]). Result: https://gist.github.com/fischman/f570886219de5c64a3b695300195c70a Resolves https://github.com/pypa/pip/issues/6141
* Update imports for the moved compat modulePradyun Gedam2018-07-291-1/+1
|
* Fix a merging artifact that broke the linterPradyun Gedam2018-07-171-45/+45
|
* Disable logging only for vendored dependenciesPradyun Gedam2018-06-271-10/+6
| | | | | The current list is already not up-to-date. This should be handled by downstream packagers if they unvendor pip's dependencies.
* Cleanup logic surrounding user_log handlerPradyun Gedam2018-06-261-7/+12
|
* Make it clearer when user_log is usedPradyun Gedam2018-06-261-5/+3
|
* Improve readability of logging setupPradyun Gedam2018-06-261-10/+14
|
* Move all logging setup into a separate functionPradyun Gedam2018-06-261-0/+90
|
* Fix typo (#5320)Jakub Wilk2018-04-221-1/+1
|
* Improve --no-color and test for it (#4866)Pradyun Gedam2017-11-201-3/+4
| | | | | | * Improve the --no-color test * Let the logger decide to not color things * misc: Move handler name outside dict