robinzyb / cp2kdata

cp2k postprocessing tools
https://robinzyb.github.io/cp2kdata/
GNU Lesser General Public License v3.0
60 stars 19 forks source link

Suggestions for logging behavior #76

Open scott-5 opened 1 month ago

scott-5 commented 1 month ago

In cp2kdata/log.py, user could control log level by environment variable, however, it changes the root logger config rather than Logger instance. I suggest using a Logger instance and keeping the root logger as default. The reason is that although there is no problem using cp2kdata alone, if cp2kdata is imported as a dependency by other packages, then log.py here will change the logging behavior in other code, unless they additionally set the environment variable separately for this dependency. However, if the log.py here is configured with a Logger instance, it will have no impact on the use of cp2kdata alone, and loggers are independent when it is used as a dependency.

robinzyb commented 1 month ago

I see, I will come up with an idea to fix this behavior.