mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-08 12:30:12 +02:00
Use a Logger to print initialization errors
This way the errors will get written to a file instead of to STDERR if `YABRIDGE_DEBUG_FILE` is set.
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
|
||||
#include "../common/logging.h"
|
||||
#include "plugin-bridge.h"
|
||||
|
||||
#define VST_EXPORT __attribute__((visibility("default")))
|
||||
@@ -55,8 +56,9 @@ VST_EXPORT AEffect* VSTPluginMain(audioMasterCallback host_callback) {
|
||||
|
||||
return &bridge->plugin;
|
||||
} catch (const std::exception& error) {
|
||||
std::cerr << "Error during initialization:" << std::endl;
|
||||
std::cerr << error.what() << std::endl;
|
||||
Logger logger = Logger::create_from_environment();
|
||||
logger.log("Error during initialization:");
|
||||
logger.log(error.what());
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user