Add logging for IAudioProcessor::process()

This is super verbose, but I'm sure it's going to be useful at some
point.
This commit is contained in:
Robbert van der Helm
2020-12-17 15:12:09 +01:00
parent 231a0293cb
commit 1ce12227fb
8 changed files with 140 additions and 20 deletions
+19 -6
View File
@@ -115,9 +115,10 @@ class Vst3Logger {
* every logging function so we don't have to repeat it everywhere.
*/
template <std::invocable<std::ostringstream&> F>
void log_request_base(bool is_host_vst, F callback) {
if (BOOST_UNLIKELY(logger.verbosity >=
Logger::Verbosity::most_events)) {
void log_request_base(bool is_host_vst,
Logger::Verbosity min_verbosity,
F callback) {
if (BOOST_UNLIKELY(logger.verbosity >= min_verbosity)) {
std::ostringstream message;
if (is_host_vst) {
message << "[host -> vst] >> ";
@@ -130,14 +131,20 @@ class Vst3Logger {
}
}
template <std::invocable<std::ostringstream&> F>
void log_request_base(bool is_host_vst, F callback) {
log_request_base(is_host_vst, Logger::Verbosity::most_events, callback);
}
/**
* Log a response with a standard prefix based on the boolean flag we pass
* to every logging function so we don't have to repeat it everywhere.
*/
template <std::invocable<std::ostringstream&> F>
void log_response_base(bool is_host_vst, F callback) {
if (BOOST_UNLIKELY(logger.verbosity >=
Logger::Verbosity::most_events)) {
void log_response_base(bool is_host_vst,
Logger::Verbosity min_verbosity,
F callback) {
if (BOOST_UNLIKELY(logger.verbosity >= min_verbosity)) {
std::ostringstream message;
if (is_host_vst) {
message << "[host -> vst] ";
@@ -149,4 +156,10 @@ class Vst3Logger {
log(message.str());
}
}
template <std::invocable<std::ostringstream&> F>
void log_response_base(bool is_host_vst, F callback) {
log_response_base(is_host_vst, Logger::Verbosity::most_events,
callback);
}
};