From 84f43ccde8b55f4b074069b1cf760abd7c6019d8 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 6 Sep 2022 20:59:19 +0200 Subject: [PATCH] LogInit: default to stderr on Windows Don't require "log_file" setting, for "--no-config" operation. Closes https://github.com/MusicPlayerDaemon/MPD/issues/1600 --- NEWS | 2 ++ src/LogInit.cxx | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index e6599e05e..f3ea930d7 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ver 0.23.10 (not yet released) +* Windows + - log to stdout by default, don't require "log_file" setting ver 0.23.9 (2022/08/18) * input diff --git a/src/LogInit.cxx b/src/LogInit.cxx index 7aeb069d3..97bf092c8 100644 --- a/src/LogInit.cxx +++ b/src/LogInit.cxx @@ -163,7 +163,10 @@ log_init(const ConfigData &config, bool verbose, bool use_stdout) return; } #endif -#ifndef HAVE_SYSLOG +#ifdef _WIN32 + /* default to stdout on Windows */ + out_fd = STDOUT_FILENO; +#elif !defined(HAVE_SYSLOG) throw std::runtime_error("config parameter 'log_file' not found"); #endif #ifdef HAVE_SYSLOG