Add logging for the...logging extension

This commit is contained in:
Robbert van der Helm
2022-10-09 00:01:16 +02:00
parent 6a1c909156
commit f68be3732e
2 changed files with 36 additions and 0 deletions
+35
View File
@@ -611,6 +611,41 @@ bool ClapLogger::log_request(bool is_host_plugin,
});
}
bool ClapLogger::log_request(bool is_host_plugin,
const clap::ext::log::host::Log& request) {
return log_request_base(is_host_plugin, [&](auto& message) {
message << request.owner_instance_id
<< ": clap_host_log::log(severity = ";
switch (request.severity) {
case CLAP_LOG_DEBUG:
message << "CLAP_LOG_DEBUG";
break;
case CLAP_LOG_INFO:
message << "CLAP_LOG_INFO";
break;
case CLAP_LOG_WARNING:
message << "CLAP_LOG_WARNING";
break;
case CLAP_LOG_ERROR:
message << "CLAP_LOG_ERROR";
break;
case CLAP_LOG_FATAL:
message << "CLAP_LOG_FATAL";
break;
case CLAP_LOG_HOST_MISBEHAVING:
message << "CLAP_LOG_HOST_MISBEHAVING";
break;
case CLAP_LOG_PLUGIN_MISBEHAVING:
message << "CLAP_LOG_PLUGIN_MISBEHAVING";
break;
default:
message << request.severity << " (unknown)";
break;
}
message << ", message = \"" << request.msg << "\")";
});
}
bool ClapLogger::log_request(bool is_host_plugin,
const clap::ext::tail::host::Changed& request) {
return log_request_base(is_host_plugin, [&](auto& message) {
+1
View File
@@ -169,6 +169,7 @@ class ClapLogger {
const clap::ext::state::host::MarkDirty&);
// Audio thread callbacks
bool log_request(bool is_host_plugin, const clap::ext::log::host::Log&);
bool log_request(bool is_host_plugin,
const clap::ext::tail::host::Changed&);