From 750130e4a5f098730479db05f408ec040a0c7543 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Tue, 5 May 2020 23:23:37 +0200 Subject: [PATCH] Print errors that happen early during startup --- CHANGELOG.md | 6 ++++++ src/plugin/host-bridge.cpp | 12 +++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bcccabcc..1ab87eab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,12 @@ Versioning](https://semver.org/spec/v2.0.0.html). that's installed for a plugin in another directory. This is not recommended though. Fixes #3. +### Fixed + +- Redirect the output from the Wine host process earlier in the startup. + Otherwise errors printed startup won't be visible, making it very hard to + diagnose problems. + ## [1.0.0] - 2020-05-03 ### Added diff --git a/src/plugin/host-bridge.cpp b/src/plugin/host-bridge.cpp index b02b9cea..beba5ae4 100644 --- a/src/plugin/host-bridge.cpp +++ b/src/plugin/host-bridge.cpp @@ -217,6 +217,13 @@ HostBridge::HostBridge(audioMasterCallback host_callback) #endif logger.log(""); + // Print the Wine host's STDOUT and STDERR streams to the log file. This + // should be done before trying to accept the sockets as otherwise we will + // miss all output. + async_log_pipe_lines(wine_stdout, wine_stdout_buffer, "[Wine STDOUT] "); + async_log_pipe_lines(wine_stderr, wine_stderr_buffer, "[Wine STDERR] "); + wine_io_handler = std::thread([&]() { io_context.run(); }); + // It's very important that these sockets are connected to in the same // order in the Wine VST host socket_acceptor.accept(host_vst_dispatch); @@ -256,11 +263,6 @@ HostBridge::HostBridge(audioMasterCallback host_callback) } }); - // Print the Wine host's STDOUT and STDERR streams to the log file - async_log_pipe_lines(wine_stdout, wine_stdout_buffer, "[Wine STDOUT] "); - async_log_pipe_lines(wine_stderr, wine_stderr_buffer, "[Wine STDERR] "); - wine_io_handler = std::thread([&]() { io_context.run(); }); - // Read the plugin's information from the Wine process. This can only be // done after we started accepting host callbacks as the plugin might do // this during initialization.