From a8a629ddcfdcd074d71aa74350a654111dd77abc Mon Sep 17 00:00:00 2001 From: Kevin Phoenix Date: Sat, 21 Sep 2024 10:12:53 -0700 Subject: [PATCH] Standardize loggers (#507) * Use __name__ for loggers * Call all the loggers log --- claripy/__init__.py | 2 +- claripy/ast/base.py | 10 +++--- claripy/ast/bool.py | 6 ++-- claripy/ast/bv.py | 6 ++-- claripy/backends/backend_concrete.py | 2 +- claripy/backends/backend_vsa.py | 6 ++-- claripy/backends/backend_z3.py | 20 +++++------ claripy/balancer.py | 2 +- claripy/frontend.py | 2 +- .../constraint_expansion_mixin.py | 2 +- claripy/frontends/composite_frontend.py | 34 +++++++++---------- claripy/frontends/constrained_frontend.py | 10 +++--- claripy/frontends/full_frontend.py | 6 ++-- claripy/frontends/hybrid_frontend.py | 2 +- claripy/frontends/light_frontend.py | 6 ++-- claripy/frontends/replacement_frontend.py | 2 +- claripy/vsa/strided_interval.py | 24 ++++++------- tests/test_solver.py | 2 +- 18 files changed, 72 insertions(+), 72 deletions(-) diff --git a/claripy/__init__.py b/claripy/__init__.py index 9b893298b..616590e15 100644 --- a/claripy/__init__.py +++ b/claripy/__init__.py @@ -43,7 +43,7 @@ def BV(name, size, explicit_name=None): # pylint:disable=function-redefined - l.critical( + log.critical( "DEPRECATION WARNING: claripy.BV is deprecated and will soon be removed. Please use claripy.BVS, instead." ) print("DEPRECATION WARNING: claripy.BV is deprecated and will soon be removed. Please use claripy.BVS, instead.") diff --git a/claripy/ast/base.py b/claripy/ast/base.py index 881ab574b..b5391705b 100644 --- a/claripy/ast/base.py +++ b/claripy/ast/base.py @@ -26,7 +26,7 @@ from claripy import Backend from claripy.annotation import Annotation -l = logging.getLogger("claripy.ast") +log = logging.getLogger(__name__) blake2b_unpacker = struct.Struct("Q") from_iterable = chain.from_iterable @@ -487,7 +487,7 @@ def _arg_serialize(arg: ArgType | Annotation) -> bytes: if hasattr(arg, "__hash__"): return hash(arg).to_bytes(8, "little", signed=True) - l.debug("Don't know how to serialize %s, consider implementing __hash__", arg) + log.debug("Don't know how to serialize %s, consider implementing __hash__", arg) return pickle.dumps(arg) def __hash__(self) -> int: @@ -844,7 +844,7 @@ def children_asts(self) -> Iterator[Base]: if isinstance(ast, Base): ast_queue.append(iter(ast.args)) - l.debug("Yielding AST %s with hash %s with %d children", ast, ast.hash(), len(ast.args)) + log.debug("Yielding AST %s with hash %s with %d children", ast, ast.hash(), len(ast.args)) yield ast def leaf_asts(self) -> Iterator[Base]: @@ -873,7 +873,7 @@ def is_leaf(self) -> bool: return self.depth == 1 def dbg_is_looped(self) -> Base | bool: # TODO: this return type is bad - l.debug("Checking AST with hash %s for looping", self.hash()) + log.debug("Checking AST with hash %s for looping", self.hash()) seen = set() for child_ast in self.children_asts(): @@ -1281,7 +1281,7 @@ def simplify(e: T) -> T: s = e._first_backend("simplify") if s is None: - l.debug("Unable to simplify expression") + log.debug("Unable to simplify expression") return e # Copy some parameters (that should really go to the Annotation backend) diff --git a/claripy/ast/bool.py b/claripy/ast/bool.py index 5e0c7ebca..966d031d2 100644 --- a/claripy/ast/bool.py +++ b/claripy/ast/bool.py @@ -15,7 +15,7 @@ if TYPE_CHECKING: from .fp import FP -l = logging.getLogger("claripy.ast.bool") +log = logging.getLogger(__name__) class Bool(Base): @@ -166,7 +166,7 @@ def is_true(e, exact=None): # pylint:disable=unused-argument with suppress(BackendError): return backends.concrete.is_true(e) - l.debug("Unable to tell the truth-value of this expression") + log.debug("Unable to tell the truth-value of this expression") return False @@ -174,7 +174,7 @@ def is_false(e, exact=None): # pylint:disable=unused-argument with suppress(BackendError): return backends.concrete.is_false(e) - l.debug("Unable to tell the truth-value of this expression") + log.debug("Unable to tell the truth-value of this expression") return False diff --git a/claripy/ast/bv.py b/claripy/ast/bv.py index 9755e503a..ac21bd58e 100644 --- a/claripy/ast/bv.py +++ b/claripy/ast/bv.py @@ -16,7 +16,7 @@ from .bits import Bits from .bool import Bool, If -l = logging.getLogger("claripy.ast.bv") +log = logging.getLogger(__name__) _bvv_cache = weakref.WeakValueDictionary() @@ -146,7 +146,7 @@ def _from_bytes(like, value): # pylint:disable=unused-argument @staticmethod def _from_str(like, value): # pylint:disable=unused-argument - l.warning("BVV value is being coerced from a unicode string, encoding as utf-8") + log.warning("BVV value is being coerced from a unicode string, encoding as utf-8") value = value.encode("utf-8") return BVV(value) @@ -268,7 +268,7 @@ def BVV(value, size=None, **kwargs) -> BV: if type(value) in (bytes, bytearray, memoryview, str): if isinstance(value, str): - l.warning("BVV value is a unicode string, encoding as utf-8") + log.warning("BVV value is a unicode string, encoding as utf-8") value = value.encode("utf-8") if size is None: diff --git a/claripy/backends/backend_concrete.py b/claripy/backends/backend_concrete.py index 1bcd15921..2e0fef66e 100644 --- a/claripy/backends/backend_concrete.py +++ b/claripy/backends/backend_concrete.py @@ -16,7 +16,7 @@ from claripy.errors import BackendError, UnsatError from claripy.operations import backend_fp_operations, backend_operations, backend_strings_operations -l = logging.getLogger("claripy.backends.backend_concrete") +log = logging.getLogger(__name__) class BackendConcrete(Backend): diff --git a/claripy/backends/backend_vsa.py b/claripy/backends/backend_vsa.py index 3c96baa93..053478357 100644 --- a/claripy/backends/backend_vsa.py +++ b/claripy/backends/backend_vsa.py @@ -23,7 +23,7 @@ ValueSet, ) -l = logging.getLogger("claripy.backends.backend_vsa") +log = logging.getLogger(__name__) def arg_filter(f): @@ -404,7 +404,7 @@ def union(self, ast): ret = converted_0.union(converted_1) if ret is NotImplemented: - l.debug("Union failed, trying the other way around.") + log.debug("Union failed, trying the other way around.") ret = converted_1.union(converted_0) return ret @@ -431,7 +431,7 @@ def widen(self, ast): ret = converted_0.widen(converted_1) if ret is NotImplemented: - l.debug("Widening failed, trying the other way around.") + log.debug("Widening failed, trying the other way around.") ret = converted_1.widen(converted_0) return ret diff --git a/claripy/backends/backend_z3.py b/claripy/backends/backend_z3.py index 8ff8f2d87..d4ca33409 100644 --- a/claripy/backends/backend_z3.py +++ b/claripy/backends/backend_z3.py @@ -31,7 +31,7 @@ from claripy.fp import RM, FSort from claripy.operations import backend_fp_operations, backend_operations, backend_strings_operations, bound_ops -l = logging.getLogger("claripy.backends.backend_z3") +log = logging.getLogger(__name__) # pylint:disable=unidiomatic-typecheck @@ -126,7 +126,7 @@ def _z3_decl_name_str(ctx, decl): def z3_solver_sat(solver, extra_constraints, occasion): - l.debug("Doing a check! (%s)", occasion) + log.debug("Doing a check! (%s)", occasion) result = solver.check(extra_constraints) @@ -290,7 +290,7 @@ def downsize(self): self._sym_cache.clear() def _name(self, o): # pylint:disable=unused-argument - l.warning("BackendZ3.name() called. This is weird.") + log.warning("BackendZ3.name() called. This is weird.") raise BackendError("name is not implemented yet") def _pop_from_ast_cache(self, _, tpl): @@ -382,7 +382,7 @@ def StringV(self, ast): @condom def StringS(self, ast): # Maybe this should be an error? Warning for now to support reliant code - l.warning("Converting claripy StringS' to z3 looses length information.") + log.warning("Converting claripy StringS' to z3 looses length information.") return z3.String(ast.args[0], ctx=self._context) # @@ -411,7 +411,7 @@ def _convert(self, obj): # pylint:disable=arguments-renamed return z3.BoolRef(z3.Z3_mk_false(self._context.ref()), self._context) if isinstance(obj, numbers.Number | str) or (hasattr(obj, "__module__") and obj.__module__ in ("z3", "z3.z3")): return obj - l.debug("BackendZ3 encountered unexpected type %s", type(obj)) + log.debug("BackendZ3 encountered unexpected type %s", type(obj)) raise BackendError(f"unexpected type {type(obj)} encountered in BackendZ3") def call(self, *args, **kwargs): # pylint;disable=arguments-renamed @@ -513,7 +513,7 @@ def _abstract_internal(self, ctx, ast, split_on=None): if op_name == "UNINTERPRETED": mystery_name = z3.Z3_get_symbol_string(ctx, z3.Z3_get_decl_name(ctx, decl)) - l.error("Mystery operation %s in BackendZ3._abstract_internal. Please report this.", mystery_name) + log.error("Mystery operation %s in BackendZ3._abstract_internal. Please report this.", mystery_name) elif op_name == "Extract": hi = z3.Z3_get_decl_int_parameter(ctx, decl, 0) lo = z3.Z3_get_decl_int_parameter(ctx, decl, 1) @@ -547,7 +547,7 @@ def _abstract_internal(self, ctx, ast, split_on=None): f"Unknown Z3 error in abstraction (result_ty == '{result_ty}'). " "Update your version of Z3, and, if the problem persists, open a claripy issue." ) - l.error(err) + log.error(err) raise BackendError(err) if op_name == "If": @@ -777,7 +777,7 @@ def _generic_model(self, z3_model): def _satisfiable(self, extra_constraints=(), solver=None, model_callback=None): self.solve_count += 1 - l.debug("Doing a check! (satisfiable)") + log.debug("Doing a check! (satisfiable)") if not z3_solver_sat(solver, extra_constraints, "satisfiable"): return False @@ -864,11 +864,11 @@ def _extrema(self, is_max: bool, expr, extra_constraints, signed, solver, model_ sat = z3_solver_sat(solver, constraints, comment) constraints.pop() if sat: - l.debug("... still sat") + log.debug("... still sat") if model_callback is not None: model_callback(self._generic_model(solver.model())) else: - l.debug("... now unsat") + log.debug("... now unsat") if sat == is_max: lo = middle else: diff --git a/claripy/balancer.py b/claripy/balancer.py index 186d3825a..27fcf971b 100644 --- a/claripy/balancer.py +++ b/claripy/balancer.py @@ -13,7 +13,7 @@ from .errors import BackendError, ClaripyBalancerError, ClaripyBalancerUnsatError, ClaripyOperationError from .operations import commutative_operations, opposites -l = logging.getLogger("claripy.balancer") +l = logging.getLogger(__name__) class Balancer: diff --git a/claripy/frontend.py b/claripy/frontend.py index c3c287dd0..c401d6ba8 100644 --- a/claripy/frontend.py +++ b/claripy/frontend.py @@ -7,7 +7,7 @@ from . import ast -l = logging.getLogger("claripy.frontends.frontend") +log = logging.getLogger(__name__) class Frontend: diff --git a/claripy/frontend_mixins/constraint_expansion_mixin.py b/claripy/frontend_mixins/constraint_expansion_mixin.py index eda8b7283..3a32dab34 100644 --- a/claripy/frontend_mixins/constraint_expansion_mixin.py +++ b/claripy/frontend_mixins/constraint_expansion_mixin.py @@ -5,7 +5,7 @@ from claripy.ast.bool import Or from claripy.ast.bv import SGE, SLE, UGE, ULE -l = logging.getLogger("claripy.frontends.cache_mixin") +log = logging.getLogger(__name__) class ConstraintExpansionMixin: diff --git a/claripy/frontends/composite_frontend.py b/claripy/frontends/composite_frontend.py index 20ad75ad0..7c94e19fb 100644 --- a/claripy/frontends/composite_frontend.py +++ b/claripy/frontends/composite_frontend.py @@ -18,7 +18,7 @@ from claripy import SolverCompositeChild -l = logging.getLogger("claripy.frontends.composite_frontend") +log = logging.getLogger(__name__) symbolic_count = itertools.count() @@ -139,7 +139,7 @@ def _solver_for_names(self, names: set[str]) -> SolverCompositeChild: :return: A composite child solver. """ - l.debug("composite_solver._merged_solver_for() running with %d names", len(names)) + log.debug("composite_solver._merged_solver_for() running with %d names", len(names)) # compute a transitive closure for all variable names all_names = set(names) @@ -159,12 +159,12 @@ def _solver_for_names(self, names: set[str]) -> SolverCompositeChild: solvers = list(solvers) if len(solvers) == 0: - l.debug("... creating new solver") + log.debug("... creating new solver") return self._template_frontend.blank_copy() if len(solvers) == 1: - l.debug("... got one solver") + log.debug("... got one solver") return solvers[0] - l.debug(".... combining %d solvers", len(solvers)) + log.debug(".... combining %d solvers", len(solvers)) return solvers[0].combine(solvers[1:]) def _shared_solvers(self, others): @@ -194,8 +194,8 @@ def _split_child(self, s): if len(ss) == 1: return [s] - l.debug("... split solver %r into %d parts", s, len(ss)) - l.debug("... variable counts: %s", [len(cs.variables) for cs in ss]) + log.debug("... split solver %r into %d parts", s, len(ss)) + log.debug("... variable counts: %s", [len(cs.variables) for cs in ss]) for ns in ss: self._owned_solvers.add(ns) @@ -259,10 +259,10 @@ def _claim(self, s): def _add_dependent_constraints(self, names, constraints, invalidate_cache=True, **kwargs): if not invalidate_cache and len(self._solvers_for_variables(names)) > 1: - l.debug("Ignoring cross-solver helper constraints.") + log.debug("Ignoring cross-solver helper constraints.") return [] - l.debug("Adding %d constraints to %d names", len(constraints), len(names)) + log.debug("Adding %d constraints to %d names", len(constraints), len(names)) s = self._claim(self._merged_solver_for(names=names)) added = s.add(constraints, invalidate_cache=invalidate_cache, **kwargs) self._store_child(s, invalidate_cache=invalidate_cache) @@ -306,7 +306,7 @@ def check_satisfiability(self, extra_constraints=(), exact=None): if self._unsat: return "UNSAT" - l.debug("%r checking satisfiability...", self) + log.debug("%r checking satisfiability...", self) if len(extra_constraints) != 0: extra_solver = self._merged_solver_for(lst=extra_constraints) @@ -406,13 +406,13 @@ def simplify(self): new_constraints = [] - l.debug("Simplifying %r with %d solvers", self, len(self._solver_list)) + log.debug("Simplifying %r with %d solvers", self, len(self._solver_list)) for s in self._solver_list: if isinstance(s, SimplifySkipperMixin) and s._simplified: new_constraints += s.constraints continue - l.debug("... simplifying child solver %r", s) + log.debug("... simplifying child solver %r", s) s.simplify() results = self._split_child(s) for ns in results: @@ -420,7 +420,7 @@ def simplify(self): ns._simplified = True new_constraints += s.constraints - l.debug("... after-split, %r has %d solvers", self, len(self._solver_list)) + log.debug("... after-split, %r has %d solvers", self, len(self._solver_list)) self.constraints = new_constraints return new_constraints @@ -465,11 +465,11 @@ def merge(self, others, merge_conditions, common_ancestor=None): if common_ancestor is not None: return self._merge_with_ancestor(common_ancestor, merge_conditions) - l.debug("Merging %s with %d other solvers.", self, len(others)) + log.debug("Merging %s with %d other solvers.", self, len(others)) merged = self.blank_copy() common_solvers = self._shared_solvers(others) common_ids = {id(s) for s in common_solvers} - l.debug("... %s common solvers", len(common_solvers)) + log.debug("... %s common solvers", len(common_solvers)) for s in common_solvers: self._owned_solvers.discard(s) @@ -481,10 +481,10 @@ def merge(self, others, merge_conditions, common_ancestor=None): noncommon_solvers = [[s for s in cs._solver_list if id(s) not in common_ids] for cs in [self, *others]] - l.debug("... merging noncommon solvers") + log.debug("... merging noncommon solvers") combined_noncommons = [] for ns in noncommon_solvers: - l.debug("... %d", len(ns)) + log.debug("... %d", len(ns)) if len(ns) == 0: s = self._template_frontend.blank_copy() combined_noncommons.append(s) diff --git a/claripy/frontends/constrained_frontend.py b/claripy/frontends/constrained_frontend.py index 82948a1a3..082e74f24 100644 --- a/claripy/frontends/constrained_frontend.py +++ b/claripy/frontends/constrained_frontend.py @@ -7,7 +7,7 @@ from claripy.ast.bool import And, Or from claripy.frontend import Frontend -l = logging.getLogger("claripy.frontends.constrained_frontend") +log = logging.getLogger(__name__) class ConstrainedFrontend(Frontend): @@ -89,9 +89,9 @@ def combine(self, others): def split(self): results = [] - l.debug("Splitting!") + log.debug("Splitting!") for variables, c_list in self.independent_constraints(): - l.debug("... got %d constraints with %d variables", len(c_list), len(variables)) + log.debug("... got %d constraints with %d variables", len(c_list), len(variables)) s = self.blank_copy() s.add(c_list) @@ -170,13 +170,13 @@ def _split_constraints(constraints, concrete=True): for i in constraints: splitted.extend(i.split(["And"])) - l.debug("... splitted of size %d", len(splitted)) + log.debug("... splitted of size %d", len(splitted)) concrete_constraints = [] variable_connections = {} constraint_connections = {} for n, s in enumerate(splitted): - l.debug("... processing constraint with %d variables", len(s.variables)) + log.debug("... processing constraint with %d variables", len(s.variables)) connected_variables = set(s.variables) connected_constraints = {n} diff --git a/claripy/frontends/full_frontend.py b/claripy/frontends/full_frontend.py index 142502bb5..e1a384c15 100644 --- a/claripy/frontends/full_frontend.py +++ b/claripy/frontends/full_frontend.py @@ -17,7 +17,7 @@ from claripy.ast.bv import BV from claripy.ast.fp import FP -l = logging.getLogger("claripy.frontends.full_frontend") +log = logging.getLogger(__name__) T = TypeVar("T", bound="FullFrontend") @@ -214,7 +214,7 @@ def max(self, e, extra_constraints=(), signed=False, exact=None): if not self.satisfiable(extra_constraints=extra_constraints): raise UnsatError("Unsat during _max()") - l.debug("Frontend.max() with %d extra_constraints", len(extra_constraints)) + log.debug("Frontend.max() with %d extra_constraints", len(extra_constraints)) # pylint: disable=unsubscriptable-object two = self.eval(e, 2, extra_constraints=extra_constraints) @@ -257,7 +257,7 @@ def min(self, e, extra_constraints=(), signed=False, exact=None): if not self.satisfiable(extra_constraints=extra_constraints): raise UnsatError("Unsat during _min()") - l.debug("Frontend.min() with %d extra_constraints", len(extra_constraints)) + log.debug("Frontend.min() with %d extra_constraints", len(extra_constraints)) # pylint: disable=unsubscriptable-object two = self.eval(e, 2, extra_constraints=extra_constraints) diff --git a/claripy/frontends/hybrid_frontend.py b/claripy/frontends/hybrid_frontend.py index fc3ff6c79..d58c43298 100644 --- a/claripy/frontends/hybrid_frontend.py +++ b/claripy/frontends/hybrid_frontend.py @@ -5,7 +5,7 @@ from claripy.errors import ClaripyFrontendError from claripy.frontend import Frontend -l = logging.getLogger("claripy.frontends.full_frontend") +log = logging.getLogger(__name__) _VALIDATE_BALANCER = False diff --git a/claripy/frontends/light_frontend.py b/claripy/frontends/light_frontend.py index 77eba8e00..01cf787f5 100644 --- a/claripy/frontends/light_frontend.py +++ b/claripy/frontends/light_frontend.py @@ -7,7 +7,7 @@ from .constrained_frontend import ConstrainedFrontend -l = logging.getLogger("claripy.frontends.light_frontend") +log = logging.getLogger(__name__) class LightFrontend(ConstrainedFrontend): @@ -74,14 +74,14 @@ def is_true(self, e, extra_constraints=(), exact=None): try: return self._solver_backend.is_true(e) except BackendError: - l.info("Light solver can't handle this is_true().") + log.info("Light solver can't handle this is_true().") return False def is_false(self, e, extra_constraints=(), exact=None): try: return self._solver_backend.is_false(e) except BackendError: - l.info("Light solver can't handle this is_false().") + log.info("Light solver can't handle this is_false().") return False def satisfiable(self, extra_constraints=(), exact=None): diff --git a/claripy/frontends/replacement_frontend.py b/claripy/frontends/replacement_frontend.py index 1a6e666b6..b9d615f9f 100644 --- a/claripy/frontends/replacement_frontend.py +++ b/claripy/frontends/replacement_frontend.py @@ -14,7 +14,7 @@ from .constrained_frontend import ConstrainedFrontend -l = logging.getLogger("claripy.frontends.replacement_frontend") +log = logging.getLogger(__name__) class ReplacementFrontend(ConstrainedFrontend): diff --git a/claripy/vsa/strided_interval.py b/claripy/vsa/strided_interval.py index 96391d9e9..9068d356c 100644 --- a/claripy/vsa/strided_interval.py +++ b/claripy/vsa/strided_interval.py @@ -18,7 +18,7 @@ from .errors import ClaripyVSAError from .valueset import ValueSet -logger = logging.getLogger("claripy.vsa.strided_interval") +log = logging.getLogger(__name__) def reversed_processor(f): @@ -1184,7 +1184,7 @@ def reversed(self): @property def size(self): - logger.warning("StridedInterval.size will be deprecated soon. Please use StridedInterval.cardinality instead.") + log.warning("StridedInterval.size will be deprecated soon. Please use StridedInterval.cardinality instead.") return self.cardinality @property @@ -1607,7 +1607,7 @@ def _wrapped_unsigned_mul(a, b): :return: The multiplication result """ if a.bits != b.bits: - logger.warning("Signed mul: two parameters have different bit length") + log.warning("Signed mul: two parameters have different bit length") bits = max(a.bits, b.bits) lb = a.lower_bound * b.lower_bound @@ -1640,7 +1640,7 @@ def _wrapped_signed_mul(a, b): # FIXME: add assert to be sure of it! if a.bits != b.bits: - logger.warning("Signed mul: two parameters have different bit length") + log.warning("Signed mul: two parameters have different bit length") bits = max(a.bits, b.bits) @@ -1980,7 +1980,7 @@ def mul(self, o): ret = StridedInterval(bits=self.bits, stride=0, lower_bound=a * b, upper_bound=a * b) if a * b > (2**self.bits - 1): - logger.warning("Overflow in multiplication detected.") + log.warning("Overflow in multiplication detected.") return ret.normalize() @@ -2345,7 +2345,7 @@ def cast_low(self, tok): mask = (1 << tok) - 1 if self.stride >= (1 << tok): - logger.warning("Tried to cast_low an interval to an interval shorter than its stride.") + log.warning("Tried to cast_low an interval to an interval shorter than its stride.") if tok == self.bits: return self.copy() @@ -2403,7 +2403,7 @@ def _unrev_cast_low(self, tok): mask = (1 << tok) - 1 if self.stride >= (1 << tok): - logger.warning("Tried to cast_low an interval to a an interval shorter than its stride.") + log.warning("Tried to cast_low an interval to a an interval shorter than its stride.") if tok == self.bits: return self.copy() @@ -2426,11 +2426,11 @@ def _unrev_cast_low(self, tok): # Keep the signs! if self.lower_bound < 0: # how this should happen ? - logger.warning("Lower bound values is less than 0") + log.warning("Lower bound values is less than 0") l = StridedInterval._to_negative(l, tok) if self.upper_bound < 0: # how this should happen ? - logger.warning("Upper bound value is less than 0") + log.warning("Upper bound value is less than 0") u = StridedInterval._to_negative(u, tok) return StridedInterval( bits=tok, stride=self.stride, lower_bound=l, upper_bound=u, uninitialized=self.uninitialized @@ -2766,7 +2766,7 @@ def pseudo_join(s, b, smart_join=True): w = s.bits if s._reversed != b._reversed: - logger.warning("Incoherent reversed flag between operands %s and %s", s, b) + log.warning("Incoherent reversed flag between operands %s and %s", s, b) uninit_flag = s.uninitialized | b.uninitialized @@ -3393,7 +3393,7 @@ def _reverse(self): if not o.is_integer: # We really don't want to do that... but well, sometimes it just happens... - logger.warning("Reversing a real strided-interval %s is bad", self) + log.warning("Reversing a real strided-interval %s is bad", self) # Reversing an integer is easy rounded_bits = ((o.bits + 7) // 8) * 8 @@ -3473,7 +3473,7 @@ def inv_is_top(si): si._reversed = o._reversed if not o.is_integer: # We really don't want to do that... but well, sometimes it just happens... - logger.warning("Reversing a real strided-interval %s is bad", self) + log.warning("Reversing a real strided-interval %s is bad", self) return si diff --git a/tests/test_solver.py b/tests/test_solver.py index 698d43868..20508d18d 100644 --- a/tests/test_solver.py +++ b/tests/test_solver.py @@ -6,7 +6,7 @@ import claripy -l = logging.getLogger("claripy.test.solver") +l = logging.getLogger(__name__) def raw_hybrid_solver(reuse_z3_solver):