Open quaquel opened 1 week ago
I haven't looked into python logging yet, but there is extensive official documentation, for example at https://docs.python.org/3/howto/logging.html
I only skimmed it now, but one thing that stood out to me was the possibility to use configuration files. This might make a nice entry point for 4), exposing this to users. They might just provide their own config file to determine how and what to log (debug level, file output, etc.)
/edit removed wrong link
I haven't used configuration files before. While reading the docs, it seems that it has been superseded by DictConfig
, which allows you to use json files: See the logging cookbook.
Oops, yes, I wanted to refer to that but provided the wrong link I thought fileConfig
can load DictConfig
, but you are right, its just for the old format. The dictConfig
method loads a DictConfig
in a dictionary format and its agnostic of where that dict originated (e.g. json or yaml)
What's the problem this feature will solve? Mesa's code base is expanding, and more functionality is being added all the time. This makes understanding how certain errors came about more complicated. Moreover, errors in reactive code, as used in the solara visualization, can be particullary tricky to diagnose. Having built-in logging in MESA will make diagnosing errors much easier.
Describe the solution you'd like Add dedicated logging functionality to MESA. This entails:
mesa.model
,mesa.visualization.solara_viz
, etc.