5

I'm working on a Python project with the Librosa sound editing library, which makes use of Numba. Every time I call a Librosa function (in this case, pitch_shift), my PyCharm console window spits out literally thousands of lines of DEBUG messages, beginning with

DEBUG:numba.byteflow:bytecode dump:
           0    NOP(arg=None, lineno=10)
           2    LOAD_GLOBAL(arg=0, lineno=10)
           4    LOAD_CONST(arg=1, lineno=10)
           6    LOAD_FAST(arg=2, lineno=10)
                     ...

I've tried turning off the debugging messages using @jit(debug=False) and os.environ['NUMBA_DEBUG']='0', but neither of these seem to be the proper way of doing this. Does anybody have experience with this, and might you lend me a hand?

sdr
  • 51
  • 3

3 Answers3

3

This worked in my case:

import librosa
import logging

logging.getLogger('numba').setLevel(logging.WARNING)
Justas
  • 5,718
  • 2
  • 34
  • 36
1

For now, just make sure your calling code does not create any fancy logger. Go with just, say,

import logging
logger = logging.getLogger(__name__)   

That fixed the issue for me.

Anatoly Alekseev
  • 2,011
  • 24
  • 27
0

I just removed the logging for debug Code, so it stops clogging up my logfiles:

logging.basicConfig(level=logging.ERROR, filename=Logfilename, filemode='w') #instead of Level=logging.DEBUG

Okapi575
  • 710
  • 1
  • 10
  • 24