sfztools / sfizz

SFZ parser and synth c++ library, providing a JACK standalone client
https://sfz.tools/sfizz/
BSD 2-Clause "Simplified" License
418 stars 58 forks source link

Add option to suppress stdout log messages in API #1089

Open vimpostor opened 2 years ago

vimpostor commented 2 years ago

Right now, if I use sfizz's C++ API and load a sfz file with loadSfzFile(), then sfizz may print out lot of stuff on stdout, e.g.:

Changing default sample path to masonhamlin-a samples/                                                                                                                                                                                       
Updating masonhamlin-a samples/MH AT2035 f A#3.wav to "MasonHamlin-A Samples/MH AT2035 f A#3.wav"
...

It would be great if there was an option to turn off this logging, as I am writing a CLI application and this verbose output is really distracting (sfizz shouldn't print something to stdout).

This option should take precendence over the compile time options defined in https://github.com/sfztools/sfizz/blob/acd866fd3d247d2fc659593cac96e88e801c29e2/src/sfizz/utility/Debug.h#L68

paulfd commented 2 years ago

Thanks for the report, I'll look into it!

redtide commented 1 year ago

@paulfd what do you think about https://github.com/gabime/spdlog?

paulfd commented 1 year ago

Last I checked it wasn't real-time safe (that said, writing to stdout isn't either). I had in mind at some point to find some way to log important things in RT.

redtide commented 1 year ago

I found gabime/spdlog#1873, but I'm not sure if it's relevant for our use case