alchemistry / alchemlyb

the simple alchemistry library
https://alchemlyb.readthedocs.io
BSD 3-Clause "New" or "Revised" License
189 stars 49 forks source link

Using loguru #301

Closed xiki-tempula closed 1 year ago

xiki-tempula commented 1 year ago

I have been using loguru for a year now and I really like it. I think this could make the logging much easier for us.

There is the user aspect. One could just do logger.add("alchemlyb.log") to save the log to a file.

Also one doesn't need to initialise a logger and the function name would just be printed to the start of the line. For debugging purpose, the loguru would also print all the public variables to the log.

orbeckst commented 1 year ago

Does it work with the Python logger? What I find useful is that my application code can just collect all logging from all libraries that it imports. It becomes a bit awkward when not all libraries respect my choices.

orbeckst commented 1 year ago

https://loguru.readthedocs.io/en/stable/overview.html looks good and to answer my own question: yes, it's compatible with standard logging

orbeckst commented 1 year ago

If you want to change over then I am ok with it.

I'd just like to have some minimal documentation that shows users how to make use of the logging facility from their own scripts.