mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-06-19 18:03:56 +02:00
Use exception logger for the memory locking error
This commit is contained in:
+11
-10
@@ -18,6 +18,8 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
#include "logging/common.h"
|
||||||
|
|
||||||
AudioShmBuffer::AudioShmBuffer(const Config& config)
|
AudioShmBuffer::AudioShmBuffer(const Config& config)
|
||||||
: config(config),
|
: config(config),
|
||||||
shm(boost::interprocess::open_or_create,
|
shm(boost::interprocess::open_or_create,
|
||||||
@@ -74,16 +76,15 @@ void AudioShmBuffer::setup_mapping() {
|
|||||||
}
|
}
|
||||||
} catch (const boost::interprocess::interprocess_exception& error) {
|
} catch (const boost::interprocess::interprocess_exception& error) {
|
||||||
if (error.get_native_error() == EAGAIN) {
|
if (error.get_native_error() == EAGAIN) {
|
||||||
std::cerr << "ERROR: Could not map shared memory. This means that"
|
Logger logger = Logger::create_exception_logger();
|
||||||
<< std::endl;
|
|
||||||
std::cerr << " your user's memory locking limit has been set"
|
logger.log("");
|
||||||
<< std::endl;
|
logger.log("ERROR: Could not map shared memory. This means that");
|
||||||
std::cerr << " too low. Check your distro's documentation or"
|
logger.log(" your user's memory locking limit has been");
|
||||||
<< std::endl;
|
logger.log(" reached. Check your distro's documentation or");
|
||||||
std::cerr << " wiki for instructions on how to set up"
|
logger.log(" wiki for instructions on how to set up");
|
||||||
<< std::endl;
|
logger.log(" realtime privileges and memlock limits.");
|
||||||
std::cerr << " realtime privileges and memlock limits."
|
logger.log("");
|
||||||
<< std::endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
throw;
|
throw;
|
||||||
|
|||||||
@@ -309,11 +309,12 @@ class Sockets {
|
|||||||
if (base_dir.string().starts_with(temp_dir.string())) {
|
if (base_dir.string().starts_with(temp_dir.string())) {
|
||||||
boost::filesystem::remove_all(base_dir);
|
boost::filesystem::remove_all(base_dir);
|
||||||
} else {
|
} else {
|
||||||
std::cerr << std::endl;
|
Logger logger = Logger::create_exception_logger();
|
||||||
std::cerr << "WARNING: Unexpected socket base directory found, "
|
|
||||||
"not removing '"
|
logger.log("");
|
||||||
<< base_dir.string() << "'" << std::endl;
|
logger.log("WARNING: Unexpected socket base directory found,");
|
||||||
std::cerr << std::endl;
|
logger.log(" not removing '" + base_dir.string() + "'");
|
||||||
|
logger.log("");
|
||||||
}
|
}
|
||||||
} catch (const boost::filesystem::filesystem_error&) {
|
} catch (const boost::filesystem::filesystem_error&) {
|
||||||
// There should not be any filesystem errors since only one side
|
// There should not be any filesystem errors since only one side
|
||||||
|
|||||||
@@ -51,8 +51,11 @@ extern "C" VST_EXPORT AEffect* VSTPluginMain(
|
|||||||
return &bridge->plugin;
|
return &bridge->plugin;
|
||||||
} catch (const std::exception& error) {
|
} catch (const std::exception& error) {
|
||||||
Logger logger = Logger::create_exception_logger();
|
Logger logger = Logger::create_exception_logger();
|
||||||
|
|
||||||
|
logger.log("");
|
||||||
logger.log("Error during initialization:");
|
logger.log("Error during initialization:");
|
||||||
logger.log(error.what());
|
logger.log(error.what());
|
||||||
|
logger.log("");
|
||||||
|
|
||||||
// Also show a desktop notification most people likely won't see the
|
// Also show a desktop notification most people likely won't see the
|
||||||
// above message
|
// above message
|
||||||
|
|||||||
@@ -54,8 +54,11 @@ bool InitModule() {
|
|||||||
return true;
|
return true;
|
||||||
} catch (const std::exception& error) {
|
} catch (const std::exception& error) {
|
||||||
Logger logger = Logger::create_exception_logger();
|
Logger logger = Logger::create_exception_logger();
|
||||||
|
|
||||||
|
logger.log("");
|
||||||
logger.log("Error during initialization:");
|
logger.log("Error during initialization:");
|
||||||
logger.log(error.what());
|
logger.log(error.what());
|
||||||
|
logger.log("");
|
||||||
|
|
||||||
// Also show a desktop notification most people likely won't see the
|
// Also show a desktop notification most people likely won't see the
|
||||||
// above message
|
// above message
|
||||||
|
|||||||
Reference in New Issue
Block a user