Add a -v (and -vv) flag and decrease default message verbosity.

This commit is contained in:
Avery Pennarun
2010-05-02 02:14:20 -04:00
parent a244b325cb
commit 2dd328ada4
7 changed files with 42 additions and 26 deletions

View File

@ -1,8 +1,17 @@
import sys, os
logprefix = ''
verbose = 0
def log(s):
sys.stdout.flush()
sys.stderr.write(logprefix + s)
sys.stderr.flush()
def debug1(s):
if verbose >= 1:
log(s)
def debug2(s):
if verbose >= 2:
log(s)