Each file and/or class should define a logger using the logging package. Each logger should follow the format basic.{filename}.function/class. Any place where a print statement might be used for debugging purposes, instead using logger.debug() so that these statements do not be removed later, and we can programatically turn them on/off through code or even an environment variable.
In the top level __init__, look for an environment variable named BASIC_LOG_LEVEL that can be used to set the log level.
For example, one use case pattern to show debug logs might be:
Each file and/or class should define a
logger
using thelogging
package. Each logger should follow the formatbasic.{filename}.function/class
. Any place where aprint
statement might be used for debugging purposes, instead usinglogger.debug()
so that these statements do not be removed later, and we can programatically turn them on/off through code or even an environment variable.In the top level
__init__
, look for an environment variable namedBASIC_LOG_LEVEL
that can be used to set the log level.For example, one use case pattern to show debug logs might be: