LogInit: default to stderr on Windows

Don't require "log_file" setting, for "--no-config" operation.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1600
This commit is contained in:
Max Kellermann 2022-09-06 20:59:19 +02:00
parent 38704c9cf3
commit 84f43ccde8
2 changed files with 6 additions and 1 deletions

2
NEWS
View File

@ -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

View File

@ -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