NEW: added new command line switch "-l" for logging to a file, also modified "-v" to set the debug level

This commit is contained in:
JohnE 2015-12-03 11:27:28 -08:00
parent 0465d31781
commit c51cfb7bad
1 changed files with 10 additions and 3 deletions

13
dbfp.py
View File

@ -16,8 +16,6 @@ FP_BASE_DIR = "fingerprints"
def main():
# logging.basicConfig(filename='dbfp.log', level=logging.DEBUG)
logging.basicConfig(level=logging.DEBUG)
parseArgs()
#
@ -144,10 +142,19 @@ def parseArgs():
parser.add_argument('-av', '--app_version', required=False)
parser.add_argument('-n', '--notes', required=False)
parser.add_argument('-pull', required=False, action='store_true', help="automated pull of applications from a physical android phone")
parser.add_argument('-v', '--verbose', action='store_true')
parser.add_argument('-v', '--verbose', action='store_true', help="will set logging level to DEBUG")
parser.add_argument('-l', '--logging', action='store_true', help="will supercede the -v option and send all logging to a file, logging.DEBUG")
# parser.add_argument('-t', '--title', required=False)
args = parser.parse_args()
if (args.logging):
logging.basicConfig(filename='dbfp.log', level=logging.DEBUG)
if (args.verbose):
logging.basicConfig(level=logging.DEBUG)
else:
logging.basicConfig(level=logging.CRITICAL)
if (args.file and args.fingerprint):
compareFingerprint(args.file, args.fingerprint)
elif (args.file and args.fpdir):