diff --git a/src/common/logging/common.cpp b/src/common/logging/common.cpp index 7b4f9f9f..b30471f8 100644 --- a/src/common/logging/common.cpp +++ b/src/common/logging/common.cpp @@ -58,7 +58,8 @@ Logger::Logger(std::shared_ptr stream, prefix_timestamp(prefix_timestamp) {} Logger Logger::create_from_environment(std::string prefix, - std::shared_ptr stream) { + std::shared_ptr stream, + bool prefix_timestamp) { bp::environment env = boost::this_process::environment(); const std::string file_path = 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() { @@ -111,7 +113,7 @@ Logger Logger::create_wine_stderr() { // we want the STDERR redirection from the group host processes to still // function here return create_from_environment( - "", std::shared_ptr(&std::cerr, [](auto*) {})); + "", std::shared_ptr(&std::cerr, [](auto*) {}), false); } void Logger::log(const std::string& message) { diff --git a/src/common/logging/common.h b/src/common/logging/common.h index a4abbab7..24054f34 100644 --- a/src/common/logging/common.h +++ b/src/common/logging/common.h @@ -122,10 +122,13 @@ class Logger { * differentiate between the Wine process and the Linux VST plugin. * @param stream If specified, disregard `YABRIDGE_DEBUG_FILE` and output * the log to this stream isntead. + * @param prefix_timestamp Whether to prefix every log message with a + * timestamp. */ static Logger create_from_environment( std::string prefix = "", - std::shared_ptr stream = nullptr); + std::shared_ptr stream = nullptr, + bool prefix_timestamp = true); /** * Create a special logger instance that outputs directly to STDERR without