[libcalamares] Add support for formatted, table-like output

- Use DebugRow for one-row-at-a-time output with continuations.
 - Use DebugList for one-item-per-line with continuations.
 - Use DebugMap for one-row-at-a-time output of a QVariantMap.
This commit is contained in:
Adriaan de Groot 2018-03-28 09:59:26 -04:00
parent 6bb72d173d
commit 240efd30f1
4 changed files with 125 additions and 9 deletions

View file

@ -1,7 +1,7 @@
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2014-2017, Teo Mrnjavac <teo@kde.org>
* Copyright 2017, Adriaan de Groot <groot@kde.org>
* Copyright 2017-2018, Adriaan de Groot <groot@kde.org>
* Copyright 2017, Gabriel Craciunescu <crazy@frugalware.org>
*
* Calamares is free software: you can redistribute it and/or modify
@ -100,12 +100,14 @@ RequirementsChecker::RequirementsChecker( QObject* parent )
if ( m_entriesToCheck.contains( "root" ) )
isRoot = checkIsRoot();
using TR = Logger::DebugRow<const char *, bool>;
cDebug() << "RequirementsChecker output:"
<< " enoughStorage:" << enoughStorage
<< " enoughRam:" << enoughRam
<< " hasPower:" << hasPower
<< " hasInternet:" << hasInternet
<< " isRoot:" << isRoot;
<< TR("enoughStorage", enoughStorage)
<< TR("enoughRam", enoughRam)
<< TR("hasPower", hasPower)
<< TR("hasInternet", hasInternet)
<< TR("isRoot", isRoot);
QList< PrepareEntry > checkEntries;
foreach ( const QString& entry, m_entriesToCheck )
@ -305,7 +307,9 @@ RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap )
}
if ( incompleteConfiguration )
cWarning() << "RequirementsChecker configuration map:\n" << configurationMap;
{
cWarning() << "RequirementsChecker configuration map:" << Logger::DebugMap( configurationMap );
}
}