mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-14 12:30:00 +02:00
Log successful FUnknown::queryInterface calls
This commit is contained in:
@@ -24,16 +24,25 @@
|
||||
|
||||
Vst3Logger::Vst3Logger(Logger& generic_logger) : logger(generic_logger) {}
|
||||
|
||||
void Vst3Logger::log_unknown_interface(
|
||||
void Vst3Logger::log_query_interface(
|
||||
const std::string& where,
|
||||
tresult result,
|
||||
const std::optional<Steinberg::FUID>& uid) {
|
||||
if (BOOST_UNLIKELY(logger.verbosity >= Logger::Verbosity::most_events)) {
|
||||
std::ostringstream message;
|
||||
std::string uid_string = uid ? format_uid(*uid) : "<unknown_pointer>";
|
||||
|
||||
std::ostringstream message;
|
||||
message << "[unknown interface] " << where << ": " << uid_string;
|
||||
|
||||
log(message.str());
|
||||
if (result == Steinberg::kResultOk) {
|
||||
if (logger.verbosity >= Logger::Verbosity::most_events) {
|
||||
message << "[query interface] " << where << ": " << uid_string;
|
||||
log(message.str());
|
||||
}
|
||||
} else {
|
||||
// TODO: DIfferentiate between interfaces we don't implement and
|
||||
// interfaces the object doesn't implement
|
||||
message << "[unknown interface] " << where << ": " << uid_string;
|
||||
log(message.str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -43,13 +43,15 @@ class Vst3Logger {
|
||||
}
|
||||
|
||||
/**
|
||||
* Log about encountering an unknown interface. The location and the UID
|
||||
* will be printed when the verbosity level is set to `most_events` or
|
||||
* higher. In case we could not get a FUID (because of null pointers, for
|
||||
* Log calls to `FUnknown::queryInterface`. This will separately log about
|
||||
* successful queries, queries for interfaces the object did not implement,
|
||||
* and queries for interfaces we do not implement depending on the verbosity
|
||||
* level. In case we could not get a FUID (because of null pointers, for
|
||||
* instance), `std::nullopt` should be passed.
|
||||
*/
|
||||
void log_unknown_interface(const std::string& where,
|
||||
const std::optional<Steinberg::FUID>& uid);
|
||||
void log_query_interface(const std::string& where,
|
||||
tresult result,
|
||||
const std::optional<Steinberg::FUID>& uid);
|
||||
|
||||
// For every object we send using `Vst3MessageHandler` we have overloads
|
||||
// that print information about the request and the response. The boolean
|
||||
|
||||
Reference in New Issue
Block a user