AlabamaASRL / asset_asrl

https://alabamaasrl.github.io/asset_asrl/
Apache License 2.0
29 stars 6 forks source link

Logging #33

Open wgledbetter opened 1 year ago

wgledbetter commented 1 year ago

Swapped all PSIOPT printing to spdlog. Output is now duplicated to terminal and log file. Current implementation has file level set to trace, and console level tied to the old PSIOPT::PrintLevel.

I don't love the filename uniqueness code, but I think we have to do something like that for when there are multiple PSIOPT instances, like in Jet.

Probably closes #25

jbpezent commented 1 year ago

I'm having some issues building it on Windows, but I'll get that part figured out. In the meantime, from glancing at the code it looks like printlevel and log level are coupled together, so by default we would be dumping a bunch of uniquely named textfiles into the users directory everytime the console comes up. Instead, I think we should have it be toggleable and be off by default.

wgledbetter commented 1 year ago

The unique files are for multiple PSIOPT instances and aren't directly related to the level. I wanted to avoid the case where multiple instances are all simultaneously dumping to the same file, which would make it basically unreadable. I do agree there should be a toggle though.