mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Remove the implicit debug log
This commit is contained in:
parent
83aae0f6b3
commit
3569a9b060
3 changed files with 4 additions and 38 deletions
|
@ -62,6 +62,9 @@
|
|||
* Fix an infinite loop when the cache directory is stored on a file system
|
||||
which does not support hard links (:pull:`2796`).
|
||||
|
||||
* Remove the implicit debug log that was written on every invocation, instead
|
||||
users will need to use ``--log`` if they wish to have one (:pull:`2798`).
|
||||
|
||||
|
||||
**6.1.1 (2015-04-07)**
|
||||
|
||||
|
|
|
@ -36,14 +36,6 @@ pip offers the :ref:`--log <--log>` option for specifying a file where a maximum
|
|||
verbosity log will be kept. This option is empty by default. This log appends
|
||||
to previous logging.
|
||||
|
||||
Additionally, pip writes a "debug log" for every command. This log appends and
|
||||
will periodically rotate and clean itself up to limit on disk file size. The
|
||||
default location is as follows:
|
||||
|
||||
* On Unix: :file:`$HOME/.cache/pip/log/debug.log`
|
||||
* On Mac OS X: :file:`$HOME/Library/Logs/pip/debug.log`
|
||||
* On Windows: :file:`C:\\Users\<username>\AppData\Local\pip\Logs\debug.log`
|
||||
|
||||
Like all pip options, ``--log`` can also be set as an environment variable, or
|
||||
placed into the pip config file. See the :ref:`Configuration` section.
|
||||
|
||||
|
|
|
@ -22,9 +22,8 @@ from pip.status_codes import (
|
|||
SUCCESS, ERROR, UNKNOWN_ERROR, VIRTUALENV_NOT_FOUND,
|
||||
PREVIOUS_BUILD_DIR_ERROR,
|
||||
)
|
||||
from pip.utils import appdirs, get_prog, normalize_path
|
||||
from pip.utils import get_prog, normalize_path
|
||||
from pip.utils.deprecation import RemovedInPip8Warning
|
||||
from pip.utils.filesystem import check_path_owner
|
||||
from pip.utils.logging import IndentingFormatter
|
||||
from pip.utils.outdated import pip_version_check
|
||||
|
||||
|
@ -120,13 +119,6 @@ class Command(object):
|
|||
else:
|
||||
level = "INFO"
|
||||
|
||||
# Compute the path for our debug log.
|
||||
debug_log_path = os.path.join(appdirs.user_log_dir("pip"), "debug.log")
|
||||
|
||||
# Ensure that the path for our debug log is owned by the current user
|
||||
# and if it is not, disable the debug log.
|
||||
write_debug_log = check_path_owner(debug_log_path)
|
||||
|
||||
logging_dictConfig({
|
||||
"version": 1,
|
||||
"disable_existing_loggers": False,
|
||||
|
@ -160,15 +152,6 @@ class Command(object):
|
|||
"stream": self.log_streams[1],
|
||||
"formatter": "indent",
|
||||
},
|
||||
"debug_log": {
|
||||
"level": "DEBUG",
|
||||
"class": "pip.utils.logging.BetterRotatingFileHandler",
|
||||
"filename": debug_log_path,
|
||||
"maxBytes": 10 * 1000 * 1000, # 10 MB
|
||||
"backupCount": 1,
|
||||
"delay": True,
|
||||
"formatter": "indent",
|
||||
},
|
||||
"user_log": {
|
||||
"level": "DEBUG",
|
||||
"class": "pip.utils.logging.BetterRotatingFileHandler",
|
||||
|
@ -182,7 +165,6 @@ class Command(object):
|
|||
"handlers": list(filter(None, [
|
||||
"console",
|
||||
"console_errors",
|
||||
"debug_log" if write_debug_log else None,
|
||||
"user_log" if options.log else None,
|
||||
])),
|
||||
},
|
||||
|
@ -204,17 +186,6 @@ class Command(object):
|
|||
),
|
||||
})
|
||||
|
||||
# We add this warning here instead of up above, because the logger
|
||||
# hasn't been configured until just now.
|
||||
if not write_debug_log:
|
||||
logger.warning(
|
||||
"The directory '%s' or its parent directory is not owned by "
|
||||
"the current user and the debug log has been disabled. Please "
|
||||
"check the permissions and owner of that directory. If "
|
||||
"executing pip with sudo, you may want sudo's -H flag.",
|
||||
os.path.dirname(debug_log_path),
|
||||
)
|
||||
|
||||
if options.log_explicit_levels:
|
||||
warnings.warn(
|
||||
"--log-explicit-levels has been deprecated and will be removed"
|
||||
|
|
Loading…
Reference in a new issue