From ce343948e2abe29f06855d6975afc8f02e8fe0ae Mon Sep 17 00:00:00 2001 From: Alex Groce Date: Sun, 23 Dec 2018 12:40:47 -0700 Subject: [PATCH] try different python approach --- bin/deepstate/common.py | 6 +++--- bin/deepstate/main_angr.py | 6 +----- bin/deepstate/main_manticore.py | 6 +----- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/bin/deepstate/common.py b/bin/deepstate/common.py index a4af86b..90fbc36 100644 --- a/bin/deepstate/common.py +++ b/bin/deepstate/common.py @@ -20,6 +20,7 @@ import argparse import md5 import os import struct +import functools class TestInfo(object): @@ -43,13 +44,12 @@ LOG_LEVEL_FATAL = 6 LOGGER = logging.getLogger("deepstate") LOGGER.setLevel(logging.DEBUG) -def log_trace(msg, *args, **kwargs): +def log_trace(msg, *args, **kwargs) logging.log(15, msg, args, kwargs) -LOGGER.trace = log_trace LOG_LEVEL_TO_LOGGER = { LOG_LEVEL_DEBUG: LOGGER.debug, - LOG_LEVEL_TRACE: LOGGER.trace, + LOG_LEVEL_TRACE: functools.partial(logging.log, 15), LOG_LEVEL_INFO: LOGGER.info, LOG_LEVEL_WARNING: LOGGER.warning, LOG_LEVEL_ERROR: LOGGER.error, diff --git a/bin/deepstate/main_angr.py b/bin/deepstate/main_angr.py index 8a52e39..cbe101a 100644 --- a/bin/deepstate/main_angr.py +++ b/bin/deepstate/main_angr.py @@ -19,12 +19,8 @@ import multiprocessing import traceback from .common import DeepState, TestInfo -logging.addLevelName(15, "TRACE") L = logging.getLogger("deepstate.angr") -def log_trace(msg, *args, **kwargs): - logging.log(15, msg, args, kwargs) -L.TRACE = 15 -L.setLevel(L.TRACE) +L.setLevel(logging.DEBUG) class DeepAngr(DeepState): diff --git a/bin/deepstate/main_manticore.py b/bin/deepstate/main_manticore.py index 1aede3c..b545385 100644 --- a/bin/deepstate/main_manticore.py +++ b/bin/deepstate/main_manticore.py @@ -31,12 +31,8 @@ from .common import DeepState, TestInfo from manticore.core.state import TerminateState -logging.addLevelName(15, "TRACE") L = logging.getLogger("deepstate.manticore") -def log_trace(msg, *args, **kwargs): - logging.log(15, msg, args, kwargs) -L.TRACE = 15 -L.setLevel(L.TRACE) +L.setLevel(logging.DEBUG) OUR_TERMINATION_REASON = "I DeepState'd it"