mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-10 04:30:12 +02:00
Abstract away logging unknown interfaces
This commit is contained in:
@@ -18,10 +18,24 @@
|
||||
|
||||
#include "src/common/serialization/vst3.h"
|
||||
|
||||
// TODO: Reconsider the output format
|
||||
|
||||
Vst3Logger::Vst3Logger(Logger& generic_logger) : logger(generic_logger) {}
|
||||
|
||||
void Vst3Logger::log_unknown_interface(
|
||||
const std::string& where,
|
||||
const std::optional<Steinberg::FUID>& uid) {
|
||||
if (BOOST_UNLIKELY(logger.verbosity >= Logger::Verbosity::most_events)) {
|
||||
char uid_string[128] = "<invalid_pointer>";
|
||||
if (uid) {
|
||||
uid->print(uid_string, Steinberg::FUID::UIDPrintStyle::kCLASS_UID);
|
||||
}
|
||||
|
||||
std::ostringstream message;
|
||||
message << "[unknown interface] " << where << ": " << uid_string;
|
||||
|
||||
log(message.str());
|
||||
}
|
||||
}
|
||||
|
||||
void Vst3Logger::log_request(bool is_host_vst, const YaComponent::Construct&) {
|
||||
log_request_base(is_host_vst, [](auto& message) {
|
||||
// TODO: Log the cid in some readable way, if possible
|
||||
|
||||
@@ -42,6 +42,15 @@ class Vst3Logger {
|
||||
logger.log_trace(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* instance), `std::nullopt` should be passed.
|
||||
*/
|
||||
void log_unknown_interface(const std::string& where,
|
||||
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
|
||||
// flag here indicates whether the request was initiated on the host side
|
||||
|
||||
Reference in New Issue
Block a user