oemof / tespy

Thermal Engineering Systems in Python (TESPy). This package provides a powerful simulation toolkit for thermal engineering plants such as power plants, district heating systems or heat pumps.
https://tespy.readthedocs.io
MIT License
256 stars 80 forks source link

Flexible logging functionality #389

Closed jowr closed 1 year ago

jowr commented 1 year ago

Hi and thank you for all the work you put into this library - very much appreciated.

We currently build a UI around the core functionality of TESPy and I thus need to capture some of the logging and printing output - either for rerouting it to the UI or for reporting progress, errors and results.

While working on this, I noticed that TESPy uses the root node logger from the logging framework. Would it be OK if I submitted a PR covering the following two points:

  1. Replace the root logger with a named logger (from the logging framework) that can be accessed and modified using a unique ID like TESPyRoot for example.
  2. Include the option to provide call-back functions to retrieve status messages instead of printing these messages directly to stdout?
fwitte commented 1 year ago

Dear @jowr,

thank you for reaching out, that sounds like a very good idea! Is there anything I can help you with to get started easier on this?

Thank your for your contribution

Francesco

jowr commented 1 year ago

No, thanks for asking though. I am going to stitch up a PR and get back to you for a critical review 😁

fwitte commented 1 year ago

Closed as completed by #390 / #391