diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-04-17 08:52:51 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-04-17 12:12:37 +0200 |
commit | d790ceeda49122fbe6cd6b66f1595355f915db4f (patch) | |
tree | a09579f95a05c1c7025930c4aeec4257bba5116a /sources/shiboken2/generator | |
parent | 4bbbf01abbae1509f9d2ee46ffaf20840abd278e (diff) |
shiboken: Refactor setting of debug level
Remove ApiExtractor::setDebugLevel(), which was just
redirecting to ReportHandler. Move functionality to set from a
command line argument to ReportHandler and add proper checks.
Task-number: PYSIDE-1265
Change-Id: I3b8ad1f40283079d88f8eaffda192a7b1f607649
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/generator')
-rw-r--r-- | sources/shiboken2/generator/main.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/sources/shiboken2/generator/main.cpp b/sources/shiboken2/generator/main.cpp index e4d86f489..7c9845886 100644 --- a/sources/shiboken2/generator/main.cpp +++ b/sources/shiboken2/generator/main.cpp @@ -33,6 +33,7 @@ #include <iostream> #include <apiextractor.h> #include <fileout.h> +#include <reporthandler.h> #include <typedatabase.h> #include <messages.h> #include "generator.h" @@ -487,14 +488,11 @@ int main(int argc, char *argv[]) } else { ait = args.find(QLatin1String("debug-level")); if (ait != args.end()) { - const QString level = ait.value(); + if (!ReportHandler::setDebugLevelFromArg(ait.value())) { + errorPrint(QLatin1String("Invalid debug level: ") + ait.value()); + return EXIT_FAILURE; + } args.erase(ait); - if (level == QLatin1String("sparse")) - extractor.setDebugLevel(ReportHandler::SparseDebug); - else if (level == QLatin1String("medium")) - extractor.setDebugLevel(ReportHandler::MediumDebug); - else if (level == QLatin1String("full")) - extractor.setDebugLevel(ReportHandler::FullDebug); } } ait = args.find(QLatin1String("no-suppress-warnings")); |