peng-lab / BaSiCPy

MIT License
66 stars 22 forks source link

Implement `logging` #24

Closed Nicholas-Schaub closed 2 years ago

Nicholas-Schaub commented 2 years ago

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:

BASIC_LOG_LEVEL=DEBUG
python basic.py --options
...
yfukai commented 2 years ago

solved in #44