In a web application I am writing, I have used the following:def dbgmsg(lvl, fmt, ...):    if dbglvl >= lvl:        # ... format and write the message        pass # just here for correctnessWhich is then used inside the code as:dbgmsg(3, Something happened)Since there is no thing such as a the #ifdef in Python to my knowledge, I need to include the code at runtime. Will the above code cause a performance impact due to the call being made even when the globally set dbglvl is 0? Which alternatives exist?
Debugging based on a debug level without performance impact?
python