From 8f060a741fa278187973de8e938b8e4fe4374adf Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 27 Feb 2020 11:33:58 +0100 Subject: [PATCH] [calamares] Default to log-level 1 (not 8) - This bug has been here since f233cac7a17d39038839a12d8223db85c4808f90, where a check for isSet() (of the -D option) was dropped. So since then, Calamares has always been running with full logging (-D8) on. - The recently-added "easter egg" of showing the debug-button when log-level is 8 (to allow debugging-in-production) trips over the default-log-level of 8, so the debug-button is always visible. So, minor bugs in the debugging-setup, combine to show a debug-button when there shouldn't be one. FIXES #1329 --- src/calamares/main.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/calamares/main.cpp b/src/calamares/main.cpp index 670b7a654..2af46119b 100644 --- a/src/calamares/main.cpp +++ b/src/calamares/main.cpp @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === * * Copyright 2014, Teo Mrnjavac - * Copyright 2017-2018, Adriaan de Groot + * Copyright 2017-2020, Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,9 +36,21 @@ #include #include +/** @brief Gets debug-level from -D command-line-option + * + * If unset, use LOGERROR (corresponding to -D1), although + * effectively -D2 is the lowest level you can set for + * logging-to-the-console, and everything always gets + * logged to the session file). + */ static unsigned int debug_level( QCommandLineParser& parser, QCommandLineOption& levelOption ) { + if ( !parser.isSet( levelOption ) ) + { + return Logger::LOGERROR; + } + bool ok = true; int l = parser.value( levelOption ).toInt( &ok ); if ( !ok || ( l < 0 ) )