mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-09 20:29:10 +02:00
Fix duplicate timestamps in Wine log messages
Regression caused by the merging of these two functions in a1cb3b6.
This commit is contained in:
@@ -58,7 +58,8 @@ Logger::Logger(std::shared_ptr<std::ostream> stream,
|
|||||||
prefix_timestamp(prefix_timestamp) {}
|
prefix_timestamp(prefix_timestamp) {}
|
||||||
|
|
||||||
Logger Logger::create_from_environment(std::string prefix,
|
Logger Logger::create_from_environment(std::string prefix,
|
||||||
std::shared_ptr<std::ostream> stream) {
|
std::shared_ptr<std::ostream> stream,
|
||||||
|
bool prefix_timestamp) {
|
||||||
bp::environment env = boost::this_process::environment();
|
bp::environment env = boost::this_process::environment();
|
||||||
const std::string file_path =
|
const std::string file_path =
|
||||||
env[logging_file_environment_variable].to_string();
|
env[logging_file_environment_variable].to_string();
|
||||||
@@ -103,7 +104,8 @@ Logger Logger::create_from_environment(std::string prefix,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return Logger(stream, verbosity_level, editor_tracing, prefix);
|
return Logger(stream, verbosity_level, editor_tracing, prefix,
|
||||||
|
prefix_timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger Logger::create_wine_stderr() {
|
Logger Logger::create_wine_stderr() {
|
||||||
@@ -111,7 +113,7 @@ Logger Logger::create_wine_stderr() {
|
|||||||
// we want the STDERR redirection from the group host processes to still
|
// we want the STDERR redirection from the group host processes to still
|
||||||
// function here
|
// function here
|
||||||
return create_from_environment(
|
return create_from_environment(
|
||||||
"", std::shared_ptr<std::ostream>(&std::cerr, [](auto*) {}));
|
"", std::shared_ptr<std::ostream>(&std::cerr, [](auto*) {}), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Logger::log(const std::string& message) {
|
void Logger::log(const std::string& message) {
|
||||||
|
|||||||
@@ -122,10 +122,13 @@ class Logger {
|
|||||||
* differentiate between the Wine process and the Linux VST plugin.
|
* differentiate between the Wine process and the Linux VST plugin.
|
||||||
* @param stream If specified, disregard `YABRIDGE_DEBUG_FILE` and output
|
* @param stream If specified, disregard `YABRIDGE_DEBUG_FILE` and output
|
||||||
* the log to this stream isntead.
|
* the log to this stream isntead.
|
||||||
|
* @param prefix_timestamp Whether to prefix every log message with a
|
||||||
|
* timestamp.
|
||||||
*/
|
*/
|
||||||
static Logger create_from_environment(
|
static Logger create_from_environment(
|
||||||
std::string prefix = "",
|
std::string prefix = "",
|
||||||
std::shared_ptr<std::ostream> stream = nullptr);
|
std::shared_ptr<std::ostream> stream = nullptr,
|
||||||
|
bool prefix_timestamp = true);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a special logger instance that outputs directly to STDERR without
|
* Create a special logger instance that outputs directly to STDERR without
|
||||||
|
|||||||
Reference in New Issue
Block a user