matthewholman / assist

ASSIST is a software package for ephemeris-quality integrations of test particles.
https://assist.readthedocs.io/
GNU General Public License v3.0
24 stars 10 forks source link

Add a way to silence stderr logging #85

Open spenczar opened 1 year ago

spenczar commented 1 year ago

I'm linking to ASSIST as a library. I have my own ways I'd like to handle errors and provide warnings to the user. It'd be nice if I could disable the fprintf(stderr, ...) calls in ASSIST, maybe with a -D flag during compilation or something.

I don't really feel that I need to be able to recover those messages in any way; just suppressing them is fine, especially if there are well-defined error codes, which is mostly the case throughout ASSIST.

hannorein commented 1 year ago

Fair enough. I don't think there's any harm done by adding a few #ifdefs. Doing anything more complicated seems like an overkill.

(Probably not what you want, but you won't see any errors after calling fclose(stderr). )