Move output to consistent logging functionality

Description

Currently we are mixing sys.stdout and print statements throughout the client and additionally we have lots of if debug: statements to handle verbosity. We should instead move to a consistent output function or use the logging functionality to make easy adjustments to output severity.
See https://docs.python.org/2/howto/logging.html

Environment

None

Activity

Show:
Meredith Slota
January 26, 2018, 11:28 PM

Bulk assigning all not-Closed issues in Python project that WERE assigned to Chris Bare to .

Chris Bare
March 7, 2016, 11:38 PM

Progress bar for downloads produces tons of output for large files, ~250,000 lines per GB. This makes log files really hard to wade through. This should be addressed as part of adding logging.

Chris Bare
October 14, 2015, 11:21 PM

Adding logging facility should fix Error messages on upload retry inconsistent with behavior

Nick Anderson
April 23, 2015, 11:22 PM
Edited

Sounds good. I thought it was going to be something like that.
Thanks!

Larsson Omberg
April 23, 2015, 10:35 PM

No, you should be pushing the logs to stdout by default. The trick is to change the many print statements to different levels of logging so that one can set the logging level in one location including weather to push to a file with:

logging.basicConfig(filename='example.log',level=logging.DEBUG)

Then we can add functionality in the constructor/config file to set the logging level.

Your pinned fields
Click on the next to a field label to start pinning.

Assignee

Unassigned

Reporter

Larsson Omberg

Validator

Xavier Schildwachter