PhysiCell
PhysiCell copied to clipboard
Exploring a log file to focus console output
This PR needs feedback before merge
I know I do not pay attention to the console output at startup mostly because it goes by so fast. I barely know what shows up there (Did you know it prints "rulesets" every time it finds a rulesets
element?). Warnings are instantly lost and not received by the user. Rulesets not enabled? You'll never know until you check the results. The console scrollback buffer can also be quickly exceeded and lose some of that opening info.
So, I am looking to have a conversation around creating a log file that puts some/most of this info into a log file to allow the user to focus on more critical output. I started with this PR that aggressively swings the pendulum the other way to show what's possible. Hopefully, with feedback, we can find a nice equilibrium.
Some notes of this implementation
- this only logs PhysiCell output, not BioFVM (namespace concerns, particularly at startup)
- create a standard way to write a PhysiCell warning/error (
log_warning
andlog_error
functions) - an optional variable to
log_output
allows the message to also be printed tostd::cout
so it is easy for devs to have both! -
log_warning
andlog_error
default to printing to console - I don't know how to easily (read: in one line) convert some of the syntax for
log_output(std::string message)
function signature. Specifically, something likestd::cout << a_string_var << " and " << a_char_var << std::endl;
so I converted these tolog_file << a_string_var << " and " << a_char_var << std::endl;
which works but creates inconsistencies - Test it on the template project or else update your Makefile