Skip to content

Commit

Permalink
modeling: make the -d debug flag set all log levels to debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Scepticz committed Jul 14, 2022
1 parent 3138e1a commit 71d9112
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modeling/fuzzware_modeling/analyze_mmio.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from .inspect_breakpoints import inspect_bp_track_newly_added_constraints, inspect_bp_trace_call, inspect_bp_trace_ret, inspect_bp_trace_liveness_reg, inspect_bp_trace_liveness_mem, inspect_cond_is_mmio_read, inspect_bp_mmio_intercept_read_after, inspect_bp_trace_reads, inspect_bp_trace_writes, inspect_bp_singleton_ensure_mmio, inspect_after_address_concretization
from .arch_specific.arm_thumb_regs import regular_register_names
from .arch_specific.arm_thumb_quirks import try_handling_decode_error
from .logging_utils import set_log_levels

l = logging.getLogger("ANA")

Expand Down Expand Up @@ -54,7 +55,7 @@

def perform_analyses(statefiles, cfg, is_debug=False, timeout=DEFAULT_TIMEOUT):
if is_debug:
l.setLevel(logging.DEBUG)
set_log_levels(logging.DEBUG)
l.debug("debug logging enabled")

result_lines, config_entries = [], []
Expand Down
18 changes: 18 additions & 0 deletions modeling/fuzzware_modeling/logging_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import logging

LOGGER_NAMES = (
"ANA",
"utils",
"BASESTATE",
"EXPLORE",
"MMIO",
"LIVENESS",
"QUIRKS",
"UTIL",
"persist_results",
)

def set_log_levels(level):
for name in LOGGER_NAMES:
logger = logging.getLogger(name)
logger.setLevel(level)

0 comments on commit 71d9112

Please sign in to comment.