diff --git a/src/common/audio-shm.cpp b/src/common/audio-shm.cpp index d1c5bb17..10614c0c 100644 --- a/src/common/audio-shm.cpp +++ b/src/common/audio-shm.cpp @@ -18,6 +18,8 @@ #include +#include "logging/common.h" + AudioShmBuffer::AudioShmBuffer(const Config& config) : config(config), shm(boost::interprocess::open_or_create, @@ -74,16 +76,15 @@ void AudioShmBuffer::setup_mapping() { } } catch (const boost::interprocess::interprocess_exception& error) { if (error.get_native_error() == EAGAIN) { - std::cerr << "ERROR: Could not map shared memory. This means that" - << std::endl; - std::cerr << " your user's memory locking limit has been set" - << std::endl; - std::cerr << " too low. Check your distro's documentation or" - << std::endl; - std::cerr << " wiki for instructions on how to set up" - << std::endl; - std::cerr << " realtime privileges and memlock limits." - << std::endl; + Logger logger = Logger::create_exception_logger(); + + logger.log(""); + logger.log("ERROR: Could not map shared memory. This means that"); + logger.log(" your user's memory locking limit has been"); + logger.log(" reached. Check your distro's documentation or"); + logger.log(" wiki for instructions on how to set up"); + logger.log(" realtime privileges and memlock limits."); + logger.log(""); } throw; diff --git a/src/common/communication/common.h b/src/common/communication/common.h index 53e84f9e..e8e687c4 100644 --- a/src/common/communication/common.h +++ b/src/common/communication/common.h @@ -309,11 +309,12 @@ class Sockets { if (base_dir.string().starts_with(temp_dir.string())) { boost::filesystem::remove_all(base_dir); } else { - std::cerr << std::endl; - std::cerr << "WARNING: Unexpected socket base directory found, " - "not removing '" - << base_dir.string() << "'" << std::endl; - std::cerr << std::endl; + Logger logger = Logger::create_exception_logger(); + + logger.log(""); + logger.log("WARNING: Unexpected socket base directory found,"); + logger.log(" not removing '" + base_dir.string() + "'"); + logger.log(""); } } catch (const boost::filesystem::filesystem_error&) { // There should not be any filesystem errors since only one side diff --git a/src/plugin/vst2-plugin.cpp b/src/plugin/vst2-plugin.cpp index f789a4c4..ed4546c1 100644 --- a/src/plugin/vst2-plugin.cpp +++ b/src/plugin/vst2-plugin.cpp @@ -51,8 +51,11 @@ extern "C" VST_EXPORT AEffect* VSTPluginMain( return &bridge->plugin; } catch (const std::exception& error) { Logger logger = Logger::create_exception_logger(); + + logger.log(""); logger.log("Error during initialization:"); logger.log(error.what()); + logger.log(""); // Also show a desktop notification most people likely won't see the // above message diff --git a/src/plugin/vst3-plugin.cpp b/src/plugin/vst3-plugin.cpp index e8fffda8..3c8c3317 100644 --- a/src/plugin/vst3-plugin.cpp +++ b/src/plugin/vst3-plugin.cpp @@ -54,8 +54,11 @@ bool InitModule() { return true; } catch (const std::exception& error) { Logger logger = Logger::create_exception_logger(); + + logger.log(""); logger.log("Error during initialization:"); logger.log(error.what()); + logger.log(""); // Also show a desktop notification most people likely won't see the // above message