From e7366006df2ad4e409fe9fc69cf452ea8c89fcd0 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sat, 26 Jun 2021 12:42:53 +0200 Subject: [PATCH] Append to the STDERR stream This got lost when changing from using `std::cerr` to opening `/dev/stderr` directly. --- CHANGELOG.md | 3 +++ src/common/logging/common.cpp | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87f6bf3c..5e935088 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,9 @@ Versioning](https://semver.org/spec/v2.0.0.html). - Fixed VST2 speaker arrangement configurations returned by the plugin not being serialized correctly. No plugins seem to actually use these, so it should not have caused any issues. +- Fixed yabridge's logging seeking STDERR to position 0 every time it writes a + log message. This would be noticeable when piping a DAW's STDERR stream to a + file when `YABRIDGE_DEBUG_LEVEL` wasn't set. - When printing the Wine version during initialization, the Wine process used for this is now run under the same environment as the Wine plugin host process will be run under. This means that when using a custom `WINELOADER` script to diff --git a/src/common/logging/common.cpp b/src/common/logging/common.cpp index da2c7302..111ad6b8 100644 --- a/src/common/logging/common.cpp +++ b/src/common/logging/common.cpp @@ -77,7 +77,8 @@ Logger Logger::create_from_environment(std::string prefix) { // the only way to do this is by reopening the STDERR and STDOUT streams // to a pipe. Luckily `/dev/stderr` stays unaffected, so we can still // write there without causing infinite loops. - return Logger(std::make_shared("/dev/stderr"), + return Logger(std::make_shared( + "/dev/stderr", std::fstream::out | std::fstream::app), verbosity_level, prefix); } }