Logging to cerr from a potentially RT context is bad even as a gross default just because it's so slow. I know we do it from R2 but I don't like it

This commit is contained in:
Chris Cannam
2022-05-25 13:54:11 +01:00
parent eb017476ca
commit 7d91fdb1b6

View File

@@ -51,7 +51,7 @@ public:
int channels;
std::function<void(const std::string &)> logger;
Parameters(double _sampleRate, int _channels,
std::function<void(const std::string &)> _log = &logCerr) :
std::function<void(const std::string &)> _log = &logCout) :
sampleRate(_sampleRate), channels(_channels), logger(_log) { }
};
@@ -205,8 +205,8 @@ protected:
return m_timeRatio * m_pitchScale;
}
static void logCerr(const std::string &message) {
std::cerr << "RubberBandStretcher: " << message << std::endl;
static void logCout(const std::string &message) {
std::cout << "RubberBandStretcher: " << message << std::endl;
}
};