From 7738c2fade5a7496fc34de7144c8bbc48d58f5f0 Mon Sep 17 00:00:00 2001 From: Assam Boudjelthia Date: Mon, 21 Oct 2024 15:40:38 +0300 Subject: [PATCH] AndroidTestRunner: print colored and brief logcats Use colors only for non-ci environment since color characters just make the output noisy and they are not rendered correctly. Change-Id: I14c5f9c215fbbe9a020011943455d2df615d9bee Reviewed-by: Ville Voutilainen (cherry picked from commit 5a07f6ca4e7f00fada0db7f21892500831d537bb) Reviewed-by: Qt Cherry-pick Bot --- src/tools/androidtestrunner/main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tools/androidtestrunner/main.cpp b/src/tools/androidtestrunner/main.cpp index 0436115c812..b1d93c30c51 100644 --- a/src/tools/androidtestrunner/main.cpp +++ b/src/tools/androidtestrunner/main.cpp @@ -585,7 +585,11 @@ static bool pullFiles() void printLogcat(const QString &formattedTime) { - QStringList logcatArgs = { "logcat"_L1 }; + QStringList logcatArgs = { "logcat"_L1, "-v"_L1, "brief"_L1 }; + + if (qEnvironmentVariable("QTEST_ENVIRONMENT") != "ci"_L1) + logcatArgs << "-v"_L1 << "color"_L1; + if (g_testInfo.sdkVersion <= 23 || g_testInfo.pid == -1) logcatArgs << "-t"_L1 << formattedTime; else