From c594e2c29630d16a43b10418a9d7d8b7deaa5c60 Mon Sep 17 00:00:00 2001 From: Hannah von Reth Date: Mon, 14 Mar 2022 12:30:40 +0100 Subject: Ensure to flush log when using stdout Especially relevant for the cmd app. --- changelog/unreleased/9515 | 5 +++++ src/libsync/logger.cpp | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/9515 diff --git a/changelog/unreleased/9515 b/changelog/unreleased/9515 new file mode 100644 index 000000000..e75aecf2b --- /dev/null +++ b/changelog/unreleased/9515 @@ -0,0 +1,5 @@ +Enhancement: Always flush log when logging to stdout + +We improved the behaviour of logging to a terminal. + +https://github.com/owncloud/client/pull/9515 diff --git a/src/libsync/logger.cpp b/src/libsync/logger.cpp index 0d57b3cd1..043b93148 100644 --- a/src/libsync/logger.cpp +++ b/src/libsync/logger.cpp @@ -145,8 +145,9 @@ void Logger::setLogFile(const QString &name) } bool openSucceeded = false; - if (name == QLatin1String("-")) { + if (name == QLatin1Char('-')) { attacheToConsole(); + setLogFlush(true); openSucceeded = _logFile.open(stdout, QIODevice::WriteOnly); } else { _logFile.setFileName(name); -- cgit v1.2.3