I'm looking at optimising some code.
For example if I have set Python's log level to info and I write code e.g.
logger.debug(....)
Does Python know that I am set to info level and effectively throw the debug statement away?
Is there a way to determine which log level is set and I could test this before doing more costly operations such as formatting strings for logging? Is it better to do this or just log and let Python determine what should be logged.
Which approach is better for performance?