mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-16 13:40:05 +02:00
Avoid potential UB in loggers using composition
This cast would work fine, but any other fields added to those loggers would be left uninitialized.
This commit is contained in:
@@ -19,9 +19,25 @@
|
||||
#include "common.h"
|
||||
|
||||
/**
|
||||
* Provides VST3-specific logging functionality for debugging plugins.
|
||||
* Wraps around `Logger` to provide VST3 specific logging functionality for
|
||||
* debugging plugins. This way we can have all the complex initialisation be
|
||||
* performed in one place.
|
||||
*/
|
||||
class Vst3Logger : public Logger {
|
||||
class Vst3Logger {
|
||||
public:
|
||||
Vst3Logger(Logger& generic_logger);
|
||||
|
||||
/**
|
||||
* @see Logger::log
|
||||
*/
|
||||
inline void log(const std::string& message) { logger.log(message); }
|
||||
|
||||
/**
|
||||
* @see Logger::log_trace
|
||||
*/
|
||||
inline void log_trace(const std::string& message) { logger.log(message); }
|
||||
|
||||
// TODO: Logging interface for VST3 plugins
|
||||
|
||||
Logger& logger;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user