I have a lot of numba compiled functions and classes in my code. For the sake of testing I have to run my program like this:
DEBUG=True python3 main.py
But when I start my program like this, numba prints tons of debug messages to stderr. These messages look like this:
2020-02-05 16:28:30,886 - numba.interpreter - DEBUG - label 0:
__numba_self_ = arg(0, name=__numba_self_) ['__numba_self_']
args = arg(1, name=args) ['args']
$4load_attr.1 = getattr(value=__numba_self_, attr=find) ['$4load_attr.1', '__numba_self_']
$8call_function_ex.3 = call $4load_attr.1(*args, func=$4load_attr.1, args=[], kws=[], vararg=args) ['$4load_attr.1', '$8call_function_ex.3', 'args']
$10return_value.4 = cast(value=$8call_function_ex.3) ['$10return_value.4', '$8call_function_ex.3']
return $10return_value.4 ['$10return_value.4']
How can I disable this output, without unsetting DEBUG environment variable?
import logging
numba_logger = logging.getLogger('numba')
numba_logger.setLevel(logging.WARNING)
will do the job. Just call at the beginning of your script!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With