paylogic / pip-accel

pip-accel: Accelerator for pip, the Python package manager
https://pypi.python.org/pypi/pip-accel
MIT License
308 stars 35 forks source link

Add option for terse logging. #59

Closed htgoebel closed 8 years ago

htgoebel commented 8 years ago

When using pip-accel for e.g. Travis-CI, the log output is much to long:

2015-10-19 23:50:55 testing-worker-linux-docker-357adccc-3199-linux-7 pip.req.req_set[3303] INFO Requirement already satisfied (use --upgrade to upgrade): wheel in /home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages (from -r tests/requirements.txt (line 9))
2015-10-19 23:50:55 testing-worker-linux-docker-357adccc-3199-linux-7 pip.download[3303] INFO File was already downloaded /home/travis/.cache/pip-accel/sources/check_manifest-0.25-py2.py3-none-any.whl

Neither timestamp nor hostname, not even the process-id is meaning full here. Instead aligning the length of the logger names would ease reading the logs.

Please add an option for setting the log format, or at least for disabling timestamp and hostname. Another option would be to add an option to use the standard logging module instead of colorlogs.

(When thinking about this, the later option would a) quickly be implemented, b) allow configuring the logformat later c) reuse the pip-accel config-file for defining the loggers (see https://docs.python.org/2/howto/logging.html#configuring-logging)

xolox commented 8 years ago

Hi Hartmut and thanks for the feedback!

Your request is reasonable and should be fairly simple to implement, so I'll see if I can add support this week. The current version of coloredlogs doesn't support configurable log formats and this has been the number one complaint since I released that package (see e.g. issue 6 and issue 7). Because of this I started working on adding support for user defined log formats last week — it's almost done. So I guess your timing is impeccable :-).

xolox commented 8 years ago

Hi Hartmut! I've released coloredlogs 3.0 which introduces support for user defined log levels.

If you change your .travis.yml to first install pip-accel, then upgrade to coloredlogs >= 3.0 (despite the huge changes most of coloredlogs has remained backwards compatible) and set the environment variable $COLOREDLOGS_LOG_FORMAT you should already be able to customize the log format. Is there any chance you can test this already? (to make sure the improvements/changes satisfy your requirements)

Regardless though, I'll leave this issue open until I've added a configuration option to pip-accel that allows to customize the log format from pip-accel configuration files.

htgoebel commented 8 years ago

Thanks. Does exactly what I need :-)

xolox commented 8 years ago

Hi again Hartmut! I've just released pip-accel 0.37 which adds support for thelog-format and log-verbosity configuration options (the corresponding environment variables are also supported). I believe the problem you reported is now fully resolved so I'm closing this issue. If you encounter any issues or disagree then feel free to reopen the issue. Thanks again for the feedback!

htgoebel commented 8 years ago

Thanks.