Start doing logging properly

This commit is contained in:
Daniel Martí 2014-01-27 15:59:40 +01:00
parent 3f43c121e5
commit caa3d4eace
3 changed files with 81 additions and 87 deletions

6
fdroid
View file

@ -19,6 +19,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys
import logging
commands = [
"build",
@ -54,6 +55,11 @@ def main():
print_help()
sys.exit(1)
verbose = any(s in sys.argv for s in ['-v', '--verbose'])
logging.basicConfig(format='%(levelname)s: %(message)s',
level=logging.DEBUG if verbose else logging.INFO)
# Trick optparse into displaying the right usage when --help is used.
sys.argv[0] += ' ' + command