From c51cfb7bad8bcd1c0fedf2abddc20557e15fa9b1 Mon Sep 17 00:00:00 2001 From: JohnE Date: Thu, 3 Dec 2015 11:27:28 -0800 Subject: [PATCH] NEW: added new command line switch "-l" for logging to a file, also modified "-v" to set the debug level --- dbfp.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/dbfp.py b/dbfp.py index 9a71173..724227a 100644 --- a/dbfp.py +++ b/dbfp.py @@ -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):