From c887fb160e05c5e9fd9e7317179363032f003a0e Mon Sep 17 00:00:00 2001 From: JP Smith Date: Tue, 11 Jul 2017 12:06:33 -0400 Subject: [PATCH] Fix script verbosity (#382) * fix script verbosity * show manticore logger * remove unused MAIN logger --- manticore/__main__.py | 2 -- manticore/manticore.py | 13 ++++--------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/manticore/__main__.py b/manticore/__main__.py index 58b3030..71092a7 100644 --- a/manticore/__main__.py +++ b/manticore/__main__.py @@ -15,8 +15,6 @@ except ImportError: pass sys.setrecursionlimit(10000) -logger = logging.getLogger('MAIN') - def parse_arguments(): ########################################################################### # parse arguments diff --git a/manticore/manticore.py b/manticore/manticore.py index 93507de..1e3b748 100644 --- a/manticore/manticore.py +++ b/manticore/manticore.py @@ -243,16 +243,11 @@ class Manticore(object): ctxfilter = ContextFilter() - logging.basicConfig(format='%(asctime)s: [%(process)d]%(stateid)s %(name)s:%(levelname)s: %(message)s', stream=sys.stdout) + logging.basicConfig(format='%(asctime)s: [%(process)d]%(stateid)s %(name)s:%(levelname)s: %(message)s', stream=sys.stdout, level=logging.ERROR) - for loggername in ['MANTICORE', 'VISITOR', 'EXECUTOR', 'CPU', 'REGISTERS', 'SMT', 'MEMORY', 'MAIN', 'PLATFORM']: + for loggername in ['MANTICORE', 'VISITOR', 'EXECUTOR', 'CPU', 'REGISTERS', 'SMT', 'MEMORY', 'PLATFORM']: logging.getLogger(loggername).addFilter(ctxfilter) logging.getLogger(loggername).setState = types.MethodType(loggerSetState, logging.getLogger(loggername)) - - logging.getLogger('SMT').setLevel(logging.INFO) - logging.getLogger('MEMORY').setLevel(logging.INFO) - logging.getLogger('LIBC').setLevel(logging.INFO) - logging.getLogger('MANTICORE').setLevel(logging.INFO) # XXX(yan): args is a temporary hack to include while we continue moving # non-Linux platforms to new-style arg handling. @@ -315,9 +310,9 @@ class Manticore(object): @verbosity.setter def verbosity(self, setting): zero = map(lambda x: (x, logging.ERROR), - ['MANTICORE', 'VISITOR', 'EXECUTOR', 'CPU', 'REGISTERS', 'SMT', 'MEMORY', 'MAIN', 'PLATFORM']) + ['MANTICORE', 'VISITOR', 'EXECUTOR', 'CPU', 'REGISTERS', 'SMT', 'MEMORY', 'PLATFORM']) levels = [zero, - [('MAIN', logging.INFO), ('EXECUTOR', logging.INFO)], + [('MANTICORE', logging.INFO), ('EXECUTOR', logging.INFO)], [('PLATFORM', logging.DEBUG)], [('MEMORY', logging.DEBUG), ('CPU', logging.DEBUG)], [('REGISTERS', logging.DEBUG)],