diff --git a/CHANGELOG.md b/CHANGELOG.md index d3fc78d3ec..ce5b9f70bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -133,6 +133,8 @@ v2.13.beta (???) - (??/??/2024) - it is possible to use FIRST and LAST at the same time. Example: xx...xx - REMOVE_SENSORS - removes all the sensors (both TLS and cameras, directly under clouds, meshes or mesh vertices) + - VERBOSITY [0-3] to set verbosity level (0 standard or higher, 1 debug or higher, 2 warning or higher,3 only error) + - to hide plugin messages it should be the first argument even before -SILENT, in this case -SILENT can be the second argument. - Improvements: diff --git a/libs/CCPluginAPI/include/ccCommandLineInterface.h b/libs/CCPluginAPI/include/ccCommandLineInterface.h index 633ddafcaa..cf1f28e487 100644 --- a/libs/CCPluginAPI/include/ccCommandLineInterface.h +++ b/libs/CCPluginAPI/include/ccCommandLineInterface.h @@ -295,7 +295,9 @@ class CCPLUGIN_LIB_API ccCommandLineInterface public: //logging //logging + virtual void printVerbose(const QString& message) const = 0; virtual void print(const QString& message) const = 0; + virtual void printHigh(const QString& message) const = 0; virtual void printDebug(const QString& message) const = 0; virtual void warning(const QString& message) const = 0; virtual void warningDebug(const QString& message) const = 0; diff --git a/libs/qCC_db/include/ccLog.h b/libs/qCC_db/include/ccLog.h index 55a38658af..309dfaef3c 100644 --- a/libs/qCC_db/include/ccLog.h +++ b/libs/qCC_db/include/ccLog.h @@ -52,12 +52,21 @@ class QCC_DB_LIB_API ccLog //! Message level enum MessageLevelFlags { - LOG_STANDARD = 0, /**< Standard message (Print) **/ - LOG_DEBUG = 1, /**< Debug only flag **/ - LOG_WARNING = 2, /**< Warning message (Warning) **/ + LOG_VERBOSE = 0, /**< Verbose message (Debug) **/ + LOG_STANDARD = 1, /**< Standard message (Print) **/ + LOG_IMPORTANT = 2, /**< Important messages (PrintHigh) **/ + LOG_WARNING = 3, /**< Warning message (Warning) **/ LOG_ERROR = 4, /**< Error message (Error) **/ + + DEBUG_FLAG = 8 /**< Debug flag (reserved) **/ }; + //! Returns the current verbosity level + static int VerbosityLevel(); + + //! Sets the verbosity level + static void SetVerbosityLevel(int level); + //! Static shortcut to ccLog::logMessage static void LogMessage(const QString& message, int level); @@ -69,57 +78,75 @@ class QCC_DB_LIB_API ccLog **/ virtual void logMessage(const QString& message, int level) = 0; + //! Prints out a verbose formatted message in console + /** Works just like the 'printf' command. + \return always 'true' + **/ + static bool PrintVerbose(const char* format, ...); + + //! QString version of ccLog::PrintVerbose + static bool PrintVerbose(const QString& message); + //! Prints out a formatted message in console /** Works just like the 'printf' command. - \return always return 'true' + \return always 'true' **/ - static bool Print(const char *format, ...); + static bool Print(const char* format, ...); //! QString version of ccLog::Print - inline static bool Print(const QString& message) { LogMessage(message, LOG_STANDARD); return true; } + static bool Print(const QString& message); + + //! Prints out an important formatted message in console + /** Works just like the 'printf' command. + \return always 'true' + **/ + static bool PrintHigh(const char* format, ...); + + //! QString version of ccLog::PrintHigh + static bool PrintHigh(const QString& message); - //! Same as Print, but works only in debug mode + //! Same as Print, but works only in Debug mode /** Works just like the 'printf' command. - \return always return 'true' + \return always 'true' **/ - static bool PrintDebug(const char *format, ...); + static bool PrintDebug(const char* format, ...); //! QString version of ccLog::PrintDebug - inline static bool PrintDebug(const QString& message) { LogMessage(message, LOG_STANDARD | LOG_DEBUG); return true; } + static bool PrintDebug(const QString& message); //! Prints out a formatted warning message in console /** Works just like the 'printf' command. - \return always return 'false' + \return always 'false' **/ - static bool Warning(const char *format, ...); + static bool Warning(const char* format, ...); //! QString version of ccLog::Warning - inline static bool Warning(const QString& message) { LogMessage(message, LOG_WARNING); return false; } + static bool Warning(const QString& message); - //! Same as Warning, but works only in debug mode + //! Same as Warning, but works only in Debug mode /** Works just like the 'printf' command. - \return always return 'false' + \return always 'false' **/ - static bool WarningDebug(const char *format, ...); + static bool WarningDebug(const char* format, ...); //! QString version of ccLog::WarningDebug - inline static bool WarningDebug(const QString& message) { LogMessage(message, LOG_WARNING | LOG_DEBUG); return false; } + static bool WarningDebug(const QString& message); //! Display an error dialog with formatted message /** Works just like the 'printf' command. - \return always return 'false' + \return always 'false' **/ - static bool Error(const char *format, ...); + static bool Error(const char* format, ...); //! QString version of 'Error' - inline static bool Error(const QString& message) { LogMessage(message, LOG_ERROR); return false; } + static bool Error(const QString& message); - //! Same as Error, but works only in debug mode + //! Same as Error, but works only in Debug mode /** Works just like the 'printf' command. - \return always return 'false' + \return always 'false' **/ - static bool ErrorDebug(const char *format, ...); + static bool ErrorDebug(const char* format, ...); //! QString version of ccLog::ErrorDebug - static bool ErrorDebug(const QString& message) { LogMessage(message, LOG_ERROR | LOG_DEBUG); return false; } + static bool ErrorDebug(const QString& message); }; diff --git a/libs/qCC_db/src/ccLog.cpp b/libs/qCC_db/src/ccLog.cpp index 9d68597c36..2ac849ce18 100644 --- a/libs/qCC_db/src/ccLog.cpp +++ b/libs/qCC_db/src/ccLog.cpp @@ -50,6 +50,14 @@ struct Message //message backup system static bool s_backupEnabled; + +//message verbosity level +#ifdef QT_DEBUG +static int s_verbosityLevel = ccLog::LOG_VERBOSE; +#else +static int s_verbosityLevel = ccLog::LOG_STANDARD; +#endif + //backed up messages static std::vector s_backupMessages; @@ -66,15 +74,23 @@ void ccLog::EnableMessageBackup(bool state) s_backupEnabled = state; } +int ccLog::VerbosityLevel() +{ + return s_verbosityLevel; +} + +void ccLog::SetVerbosityLevel(int level) +{ + s_verbosityLevel = std::min(level, static_cast(LOG_ERROR)); // can't ignore error messages +} + void ccLog::LogMessage(const QString& message, int level) { -#ifndef QT_DEBUG - //skip debug messages in release mode as soon as possible - if (level & LOG_DEBUG) + //skip messages below the current 'verbosity' level + if ((level & 7) < s_verbosityLevel) { return; } -#endif if (s_instance) { @@ -119,36 +135,94 @@ void ccLog::RegisterInstance(ccLog* logInstance) LogMessage(QString(s_buffer), flags);\ }\ +bool ccLog::PrintVerbose(const char* format, ...) +{ + LOG_ARGS(LOG_VERBOSE) + return true; +} + +bool ccLog::PrintVerbose(const QString& message) +{ + LogMessage(message, LOG_VERBOSE); + return true; +} + bool ccLog::Print(const char* format, ...) { LOG_ARGS(LOG_STANDARD) return true; } +bool ccLog::Print(const QString& message) +{ + LogMessage(message, LOG_STANDARD); + return true; +} + +bool ccLog::PrintHigh(const char* format, ...) +{ + LOG_ARGS(LOG_IMPORTANT) + return true; +} + +bool ccLog::PrintHigh(const QString& message) +{ + LogMessage(message, LOG_IMPORTANT); + return true; +} + bool ccLog::Warning(const char* format, ...) { LOG_ARGS(LOG_WARNING) return false; } +bool ccLog::Warning(const QString& message) +{ + LogMessage(message, LOG_WARNING); + return false; +} + bool ccLog::Error(const char* format, ...) { LOG_ARGS(LOG_ERROR) return false; } +bool ccLog::Error(const QString& message) +{ + LogMessage(message, LOG_ERROR); + return false; +} + bool ccLog::PrintDebug(const char* format, ...) { #ifdef QT_DEBUG - LOG_ARGS(LOG_STANDARD | LOG_DEBUG) + LOG_ARGS(LOG_STANDARD | DEBUG_FLAG) #endif - return true; + return false; +} + +bool ccLog::PrintDebug(const QString& message) +{ +#ifdef QT_DEBUG + LogMessage(message, LOG_STANDARD | DEBUG_FLAG); +#endif + return false; } bool ccLog::WarningDebug(const char* format, ...) { #ifdef QT_DEBUG - LOG_ARGS(LOG_WARNING | LOG_DEBUG) + LOG_ARGS(LOG_WARNING) +#endif + return false; +} + +bool ccLog::WarningDebug(const QString& message) +{ +#ifdef QT_DEBUG + LogMessage(message, LOG_WARNING | DEBUG_FLAG); #endif return false; } @@ -156,7 +230,15 @@ bool ccLog::WarningDebug(const char* format, ...) bool ccLog::ErrorDebug(const char* format, ...) { #ifdef QT_DEBUG - LOG_ARGS(LOG_ERROR | LOG_DEBUG) + LOG_ARGS(LOG_ERROR) +#endif + return false; +} + +bool ccLog::ErrorDebug(const QString& message) +{ +#ifdef QT_DEBUG + LogMessage(message, LOG_ERROR | DEBUG_FLAG); #endif return false; } diff --git a/qCC/ccCommandLineCommands.cpp b/qCC/ccCommandLineCommands.cpp index 8de42c812a..3c660701f9 100644 --- a/qCC/ccCommandLineCommands.cpp +++ b/qCC/ccCommandLineCommands.cpp @@ -171,6 +171,7 @@ constexpr char COMMAND_FEATURE[] = "FEATURE"; constexpr char COMMAND_RGB_CONVERT_TO_SF[] = "RGB_CONVERT_TO_SF"; constexpr char COMMAND_FLIP_TRIANGLES[] = "FLIP_TRI"; constexpr char COMMAND_DEBUG[] = "DEBUG"; +constexpr char COMMAND_VERBOSITY[] = "VERBOSITY"; //options / modifiers constexpr char COMMAND_MAX_THREAD_COUNT[] = "MAX_TCOUNT"; @@ -572,7 +573,6 @@ CommandLoad::CommandLoad() bool CommandLoad::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[LOADING]")); if (cmd.arguments().empty()) { return cmd.error(QObject::tr("Missing parameter: filename after \"-%1\"").arg(COMMAND_OPEN)); @@ -637,12 +637,11 @@ bool CommandLoad::process(ccCommandLineInterface& cmd) } CommandLoadCommandFile::CommandLoadCommandFile() - : ccCommandLineInterface::Command(QObject::tr("CommandFile"), COMMAND_COMMAND_FILE) + : ccCommandLineInterface::Command(QObject::tr("Load commands from file"), COMMAND_COMMAND_FILE) {} bool CommandLoadCommandFile::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[LOADING COMMANDS FROM FILE]")); if (cmd.arguments().empty()) { return cmd.error(QObject::tr("Missing parameter: filename after \"-%1\"").arg(COMMAND_COMMAND_FILE)); @@ -800,7 +799,6 @@ CommandClearNormals::CommandClearNormals() bool CommandClearNormals::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[CLEAR NORMALS]")); if (cmd.clouds().empty() && cmd.meshes().empty()) { return cmd.error(QObject::tr("No entity loaded (be sure to open at least one file with \"-%1 [cloud filename]\" before \"-%2\")").arg(COMMAND_OPEN, COMMAND_CLEAR_NORMALS)); @@ -851,8 +849,6 @@ CommandInvertNormal::CommandInvertNormal() bool CommandInvertNormal::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[INVERT NORMALS]")); - if (cmd.clouds().empty() && cmd.meshes().empty()) { return cmd.error(QObject::tr("No input point cloud or mesh (be sure to open one with \"-%1 [cloud filename]\" before \"-%2\")").arg(COMMAND_OPEN, COMMAND_INVERT_NORMALS)); @@ -915,7 +911,6 @@ CommandOctreeNormal::CommandOctreeNormal() bool CommandOctreeNormal::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[OCTREE NORMALS CALCULATION]")); if (cmd.clouds().empty()) { return cmd.error(QObject::tr("No point cloud to compute normals (be sure to open one with \"-%1 [cloud filename]\" before \"-%2\")").arg(COMMAND_OPEN, COMMAND_COMPUTE_OCTREE_NORMALS)); @@ -1116,7 +1111,6 @@ CommandConvertNormalsToDipAndDipDir::CommandConvertNormalsToDipAndDipDir() bool CommandConvertNormalsToDipAndDipDir::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[CONVERT NORMALS TO DIP/DIP DIR]")); if (cmd.clouds().empty()) { return cmd.error(QObject::tr("No input point cloud (be sure to open one with \"-%1 [cloud filename]\" before \"-%2\")").arg(COMMAND_OPEN, COMMAND_CONVERT_NORMALS_TO_DIP)); @@ -1158,7 +1152,6 @@ CommandConvertNormalsToSFs::CommandConvertNormalsToSFs() bool CommandConvertNormalsToSFs::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[CONVERT NORMALS TO SCALAR FIELD(S)]")); if (cmd.clouds().empty()) { return cmd.error(QObject::tr("No input point cloud (be sure to open one with \"-%1 [cloud filename]\" before \"-%2\")").arg(COMMAND_OPEN, COMMAND_CONVERT_NORMALS_TO_SFS)); @@ -1202,7 +1195,6 @@ CommandConvertNormalsToHSV::CommandConvertNormalsToHSV() bool CommandConvertNormalsToHSV::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[CONVERT NORMALS TO HSV COLORS]")); if (cmd.clouds().empty()) { return cmd.error(QObject::tr("No input point cloud (be sure to open one with \"-%1 [cloud filename]\" before \"-%2\")").arg(COMMAND_OPEN, COMMAND_CONVERT_NORMALS_TO_HSV)); @@ -1244,7 +1236,6 @@ CommandSubsample::CommandSubsample() bool CommandSubsample::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[SUBSAMPLING]")); if (cmd.clouds().empty()) { return cmd.error(QObject::tr("No point cloud to resample (be sure to open one with \"-%1 [cloud filename]\" before \"-%2\")").arg(COMMAND_OPEN, COMMAND_SUBSAMPLE)); @@ -1600,7 +1591,11 @@ bool CommandSubsample::process(ccCommandLineInterface& cmd) for (CLCloudDesc& desc : cmd.clouds()) { //calculate octree before subsampling, it is passed to subsampling, so it won't be recalculated there. - CCCoreLib::DgmOctree* octree = desc.pc->computeOctree(nullptr, false).data(); + CCCoreLib::DgmOctree* octree = desc.pc->getOctree().data(); + if (!octree) + { + octree = desc.pc->computeOctree(nullptr, false).data(); + } if (!octree) { return cmd.error("Octree calculation failed, not enough memory?"); @@ -1726,7 +1721,6 @@ CommandExtractCCs::CommandExtractCCs() bool CommandExtractCCs::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[CONNECTED COMPONENTS EXTRACTION]")); if (cmd.clouds().empty()) { return cmd.error(QObject::tr("No point cloud loaded (be sure to open one with \"-%1 [cloud filename]\" before \"-%2\")").arg(COMMAND_OPEN, COMMAND_EXTRACT_CC)); @@ -1881,8 +1875,6 @@ CommandCurvature::CommandCurvature() bool CommandCurvature::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[CURVATURE]")); - if (cmd.arguments().empty()) { return cmd.error(QObject::tr("Missing parameter: curvature type after \"-%1\"").arg(COMMAND_CURVATURE)); @@ -1975,12 +1967,11 @@ static bool ReadDensityType(ccCommandLineInterface& cmd, CCCoreLib::GeometricalA } CommandApproxDensity::CommandApproxDensity() - : ccCommandLineInterface::Command(QObject::tr("ApproxDensity"), COMMAND_APPROX_DENSITY) + : ccCommandLineInterface::Command(QObject::tr("Approx Density"), COMMAND_APPROX_DENSITY) {} bool CommandApproxDensity::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[APPROX DENSITY]")); if (cmd.clouds().empty()) { return cmd.error(QObject::tr("No point cloud on which to compute approx. density! (be sure to open one with \"-%1 [cloud filename]\" before \"-%2\")").arg(COMMAND_OPEN, COMMAND_APPROX_DENSITY)); @@ -2033,8 +2024,6 @@ CommandDensity::CommandDensity() bool CommandDensity::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[DENSITY]")); - if (cmd.arguments().empty()) { return cmd.error(QObject::tr("Missing parameter: sphere radius after \"-%1\"").arg(COMMAND_DENSITY)); @@ -2101,8 +2090,6 @@ CommandSFGradient::CommandSFGradient() bool CommandSFGradient::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[SF GRADIENT]")); - if (cmd.arguments().empty()) { return cmd.error(QObject::tr("Missing parameter: boolean (whether SF is euclidean or not) after \"-%1\"").arg(COMMAND_SF_GRADIENT)); @@ -2172,8 +2159,6 @@ CommandRoughness::CommandRoughness() bool CommandRoughness::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[ROUGHNESS]")); - if (cmd.arguments().empty()) { return cmd.error(QObject::tr("Missing parameter: kernel size after \"-%1\"").arg(COMMAND_ROUGHNESS)); @@ -2244,8 +2229,6 @@ CommandApplyTransformation::CommandApplyTransformation() bool CommandApplyTransformation::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[APPLY TRANSFORMATION]")); - //optional parameters bool inverse = false; bool applyToGlobal = false; @@ -2480,8 +2463,6 @@ CommandDropGlobalShift::CommandDropGlobalShift() bool CommandDropGlobalShift::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[DROP GLOBAL SHIFT]")); - if (cmd.clouds().empty() && cmd.meshes().empty()) { return cmd.error(QObject::tr("No loaded entity! (be sure to open one with \"-%1 [filename]\" before \"-%2\")").arg(COMMAND_OPEN, COMMAND_DROP_GLOBAL_SHIFT)); @@ -2512,8 +2493,6 @@ CommandSFColorScale::CommandSFColorScale() bool CommandSFColorScale::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[SF COLOR SCALE]")); - if (cmd.arguments().empty()) { return cmd.error(QObject::tr("Missing parameter: color scale file after \"-%1\"").arg(COMMAND_SF_COLOR_SCALE)); @@ -2586,8 +2565,6 @@ CommandSFConvertToRGB::CommandSFConvertToRGB() bool CommandSFConvertToRGB::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[SF CONVERT TO RGB]")); - if (cmd.arguments().empty()) { return cmd.error(QObject::tr("Missing parameter: boolean (whether to mix with existing colors or not) after \"-%1\"").arg(COMMAND_SF_CONVERT_TO_RGB)); @@ -2655,7 +2632,6 @@ CommandRGBConvertToSF::CommandRGBConvertToSF() bool CommandRGBConvertToSF::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[RGB CONVERT TO SF]")); if (cmd.clouds().empty()) { return cmd.error(QObject::tr("No point cloud on which to convert RGB to SF! (be sure to open one with \"-%1 [cloud filename]\" before \"-%2\")").arg(COMMAND_OPEN, COMMAND_RGB_CONVERT_TO_SF)); @@ -2812,8 +2788,6 @@ static USE_SPECIAL_SF_VALUE ToSpecialSFValue(QString valString) bool CommandFilterBySFValue::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[FILTER BY VALUE]")); - USE_SPECIAL_SF_VALUE useValForMin = USE_NONE; ScalarType minVal = 0; QString minValStr; @@ -3016,8 +2990,6 @@ CommandComputeMeshVolume::CommandComputeMeshVolume() bool CommandComputeMeshVolume::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[COMPUTE MESH VOLUME]")); - if (cmd.meshes().empty()) { cmd.warning(QObject::tr("No mesh loaded! Nothing to do...")); @@ -3089,8 +3061,6 @@ CommandMergeMeshes::CommandMergeMeshes() bool CommandMergeMeshes::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[MERGE MESHES]")); - if (cmd.meshes().size() < 2) { cmd.warning(QObject::tr("Less than 2 meshes are loaded! Nothing to do...")); @@ -3166,8 +3136,6 @@ CommandMergeClouds::CommandMergeClouds() bool CommandMergeClouds::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[MERGE CLOUDS]")); - if (cmd.clouds().size() < 2) { cmd.warning(QObject::tr("Less than 2 clouds are loaded! Nothing to do...")); @@ -3219,8 +3187,6 @@ CommandSetGlobalShift::CommandSetGlobalShift() bool CommandSetGlobalShift::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[SET GLOBAL SHIFT]")); - if (cmd.clouds().empty() && cmd.meshes().empty()) { return cmd.error(QObject::tr("No loaded entity! (be sure to open one with \"-%1 [filename]\" before \"-%2\")").arg(COMMAND_OPEN, COMMAND_SET_GLOBAL_SHIFT)); @@ -3674,8 +3640,6 @@ CommandMatchBBCenters::CommandMatchBBCenters() bool CommandMatchBBCenters::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[MATCH B.B. CENTERS]")); - std::vector entities; for (auto& cloud : cmd.clouds()) { @@ -3724,13 +3688,11 @@ bool CommandMatchBBCenters::process(ccCommandLineInterface& cmd) } CommandMatchBestFitPlane::CommandMatchBestFitPlane() - : ccCommandLineInterface::Command(QObject::tr("Match best fit plane"), COMMAND_BEST_FIT_PLANE) + : ccCommandLineInterface::Command(QObject::tr("Compute best fit plane"), COMMAND_BEST_FIT_PLANE) {} bool CommandMatchBestFitPlane::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[COMPUTE BEST FIT PLANE]")); - //look for local options bool makeCloudsHoriz = false; bool keepLoaded = false; @@ -3868,8 +3830,6 @@ CommandOrientNormalsMST::CommandOrientNormalsMST() bool CommandOrientNormalsMST::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[ORIENT NORMALS (MST)]")); - if (cmd.arguments().empty()) { return cmd.error(QObject::tr("Missing parameter: number of neighbors after \"-%1\"").arg(COMMAND_ORIENT_NORMALS)); @@ -3938,8 +3898,6 @@ CommandSORFilter::CommandSORFilter() bool CommandSORFilter::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[SOR FILTER]")); - if (cmd.arguments().empty()) { return cmd.error(QObject::tr("Missing parameter: number of neighbors mode after \"-%1\"").arg(COMMAND_SOR_FILTER)); @@ -4040,8 +3998,6 @@ CommandNoiseFilter::CommandNoiseFilter() bool CommandNoiseFilter::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[NOISE FILTER]")); - if (cmd.arguments().size() < 4) { return cmd.error(QObject::tr("Missing parameters: 'KNN/RADIUS {value} REL/ABS {value}' expected after \"-%1\"").arg(COMMAND_NOISE_FILTER)); @@ -4191,8 +4147,6 @@ CommandRemoveDuplicatePoints::CommandRemoveDuplicatePoints() bool CommandRemoveDuplicatePoints::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[REMOVE DUPLICATE POINTS]")); - double minDistanceBetweenPoints = std::numeric_limits::epsilon(); //get optional argument @@ -4246,13 +4200,11 @@ bool CommandRemoveDuplicatePoints::process(ccCommandLineInterface& cmd) } CommandExtractVertices::CommandExtractVertices() - : ccCommandLineInterface::Command(QObject::tr("Extract vertices (as a standalone 'cloud')"), COMMAND_EXTRACT_VERTICES) + : ccCommandLineInterface::Command(QObject::tr("Extract vertices"), COMMAND_EXTRACT_VERTICES) {} bool CommandExtractVertices::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[EXTRACT VERTICES]")); - if (cmd.meshes().empty()) { cmd.warning(QObject::tr("No mesh available. Be sure to open one first!")); @@ -4298,13 +4250,11 @@ bool CommandExtractVertices::process(ccCommandLineInterface& cmd) CommandFlipTriangles::CommandFlipTriangles() - : ccCommandLineInterface::Command(QObject::tr("Flip the vertices order of all opened mesh triangles"), COMMAND_FLIP_TRIANGLES) + : ccCommandLineInterface::Command(QObject::tr("Flip mesh triangles"), COMMAND_FLIP_TRIANGLES) {} bool CommandFlipTriangles::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[FLIP TRIANGLES]")); - if (cmd.meshes().empty()) { cmd.warning(QObject::tr("No mesh available. Be sure to open one first!")); @@ -4345,8 +4295,6 @@ CommandSampleMesh::CommandSampleMesh() bool CommandSampleMesh::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[SAMPLE POINTS ON MESH]")); - if (cmd.arguments().empty()) { return cmd.error(QObject::tr("Missing parameter: sampling mode after \"-%1\" (POINTS/DENSITY)").arg(COMMAND_SAMPLE_MESH)); @@ -4426,13 +4374,11 @@ bool CommandSampleMesh::process(ccCommandLineInterface& cmd) } CommandCompressFWF::CommandCompressFWF() - : ccCommandLineInterface::Command(QObject::tr("Sample mesh"), COMMAND_COMPRESS_FWF) + : ccCommandLineInterface::Command(QObject::tr("Compress FWF"), COMMAND_COMPRESS_FWF) {} bool CommandCompressFWF::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[COMPRESS FWF]")); - if (cmd.clouds().empty()) { return cmd.error(QObject::tr("No point cloud available. Be sure to open or generate one first!")); @@ -4452,8 +4398,6 @@ CommandCrop::CommandCrop() bool CommandCrop::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[CROP]")); - if (cmd.arguments().empty()) { return cmd.error(QObject::tr("Missing parameter: box extents after \"-%1\" (Xmin:Ymin:Zmin:Xmax:Ymax:Zmax)").arg(COMMAND_CROP)); @@ -4600,8 +4544,6 @@ CommandSFToCoord::CommandSFToCoord() bool CommandSFToCoord::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[SF TO COORD]")); - if (cmd.arguments().size() < 2) { return cmd.error(QObject::tr("Missing parameter(s) after \"-%1\" (SF INDEX OR NAME) (DIMENSION)").arg(COMMAND_SF_TO_COORD)); @@ -4663,8 +4605,6 @@ CommandCoordToSF::CommandCoordToSF() bool CommandCoordToSF::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[COORD TO SF]")); - if (cmd.arguments().empty()) { return cmd.error(QObject::tr("Missing parameter after \"-%1\" (DIMENSION)").arg(COMMAND_COORD_TO_SF)); @@ -4712,8 +4652,6 @@ CommandCrop2D::CommandCrop2D() bool CommandCrop2D::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[CROP 2D]")); - if (cmd.arguments().size() < 6) { return cmd.error(QObject::tr("Missing parameter(s) after \"-%1\" (ORTHO_DIM N X1 Y1 X2 Y2 ... XN YN)").arg(COMMAND_CROP_2D)); @@ -4867,8 +4805,6 @@ CommandColorBanding::CommandColorBanding() bool CommandColorBanding::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[COLOR BANDING]")); - if (cmd.arguments().size() < 2) { return cmd.error(QObject::tr("Missing parameter(s) after \"-%1\" (DIM FREQUENCY)").arg(COMMAND_COLOR_BANDING)); @@ -4979,8 +4915,6 @@ CommandColorLevels::CommandColorLevels() bool CommandColorLevels::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[COLOR LEVELS]")); - if (cmd.arguments().size() < 5) { return cmd.error(QObject::tr("Missing parameter(s) after \"-%1\" (COLOR-BANDS MIN-INPUT-LEVEL MAX-INPUT-LEVEL MIN-OUTPUT-LEVEL MAX-OUTPUT-LEVEL)").arg(COMMAND_COLOR_LEVELS)); @@ -5083,8 +5017,6 @@ CommandDist::CommandDist(bool cloud2meshDist, const QString& name, const QString bool CommandDist::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[DISTANCE COMPUTATION]")); - //compared cloud CLEntityDesc* compEntity = nullptr; ccHObject* compCloud = nullptr; @@ -5435,8 +5367,6 @@ CommandCPS::CommandCPS() bool CommandCPS::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[CLOSEST POINT SET]")); - if (cmd.clouds().size() < 2) { return cmd.error(QObject::tr("At least two point clouds are needed to compute the closest point set!")); @@ -5489,8 +5419,6 @@ CommandStatTest::CommandStatTest() bool CommandStatTest::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[STATISTICAL TEST]")); - //distribution CCCoreLib::GenericDistribution* distrib = nullptr; { @@ -5696,8 +5624,6 @@ CommandDelaunayTri::CommandDelaunayTri() bool CommandDelaunayTri::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[DELAUNAY TRIANGULATION]")); - bool axisAligned = true; double maxEdgeLength = 0; @@ -5798,8 +5724,6 @@ CommandSFArithmetic::CommandSFArithmetic() bool CommandSFArithmetic::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[SF ARITHMETIC]")); - if (cmd.arguments().size() < 2) { return cmd.error(QObject::tr("Missing parameter(s): SF index and/or operation after '%1' (2 values expected)").arg(COMMAND_SF_ARITHMETIC)); @@ -5907,8 +5831,6 @@ CommandSFOperation::CommandSFOperation() bool CommandSFOperation::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[SF OPERATION]")); - if (cmd.arguments().size() < 3) { return cmd.error(QObject::tr("Missing parameter(s): SF index and/or operation and/or scalar value after '%1' (3 values expected)").arg(COMMAND_SF_OP)); @@ -6014,8 +5936,6 @@ CommandSFOperationSF::CommandSFOperationSF() bool CommandSFOperationSF::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[SF OP [ADD | SUB | MULT | DIV] SF]")); - if (cmd.arguments().size() < 3) { return cmd.error(QObject::tr("Missing parameter(s): SF index and operation and SF index '%1' (3 values expected)").arg(COMMAND_SF_OP_SF)); @@ -6126,8 +6046,6 @@ CommandSFInterpolation::CommandSFInterpolation() bool CommandSFInterpolation::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[SF INTERPOLATION]")); - if (cmd.arguments().size() < 1) return cmd.error(QObject::tr("Missing parameter(s): SF index after '%1' (1 value expected)").arg(COMMAND_SF_INTERP)); @@ -6194,8 +6112,6 @@ CommandColorInterpolation::CommandColorInterpolation() bool CommandColorInterpolation::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[COLOR INTERPOLATION]")); - if (cmd.clouds().size() < 2) return cmd.error(QObject::tr("Unexpected number of clouds for '%1' (at least 2 clouds expected: first = source, second = dest)").arg(COMMAND_COLOR_INTERP)); @@ -6212,8 +6128,6 @@ CommandRenameEntities::CommandRenameEntities() bool CommandRenameEntities::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[RENAME ENTITIES]")); - if (cmd.arguments().empty()) { return cmd.error(QObject::tr("Missing parameter: Name after \"-%1\"").arg(COMMAND_RENAME_ENTITIES)); @@ -6261,7 +6175,7 @@ bool CommandRenameEntities::process(ccCommandLineInterface& cmd) { currentMeshName += "-" + QString::number(index).rightJustified(3, '0'); } - cmd.error("Mesh '" + desc.mesh->getName() + "' renamed to '" + currentMeshName + "'"); + cmd.print("Mesh '" + desc.mesh->getName() + "' renamed to '" + currentMeshName + "'"); //rename the Mesh entity desc.mesh->setName(currentMeshName); //rename the Root entity @@ -6279,8 +6193,6 @@ CommandSFRename::CommandSFRename() bool CommandSFRename::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[RENAME SF]")); - if (cmd.arguments().size() < 2) { return cmd.error(QObject::tr("Missing parameter(s): SF index and/or scalar field name after '%1' (2 values expected)").arg(COMMAND_RENAME_SF)); @@ -6369,12 +6281,12 @@ bool CommandSFRename::process(ccCommandLineInterface& cmd) } CommandSFAddConst::CommandSFAddConst() - : ccCommandLineInterface::Command(QObject::tr("SF add constant scalar field"), COMMAND_SF_ADD_CONST) + : ccCommandLineInterface::Command(QObject::tr("Add constant SF"), COMMAND_SF_ADD_CONST) {} bool CommandSFAddConst::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[ADD CONST SF] Note: this operation is only done on clouds")); + cmd.print(QObject::tr("Note: this operation is only done on clouds")); if (cmd.arguments().size() < 2) { @@ -6430,13 +6342,11 @@ bool CommandSFAddConst::process(ccCommandLineInterface& cmd) } CommandSFAddId::CommandSFAddId() - : ccCommandLineInterface::Command(QObject::tr("Add point indexes as scalar field"), COMMAND_SF_ADD_ID) + : ccCommandLineInterface::Command(QObject::tr("Add indexes as SF"), COMMAND_SF_ADD_ID) {} bool CommandSFAddId::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[SF_ADD_ID]")); - ccHObject::Container selectedEntities; bool addIdAsInt = false; @@ -6473,8 +6383,6 @@ CommandICP::CommandICP() bool CommandICP::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[ICP]")); - //look for local options bool referenceIsFirst = false; bool adjustScale = false; @@ -7125,13 +7033,11 @@ bool CommandLogFile::process(ccCommandLineInterface& cmd) } CommandSelectEntities::CommandSelectEntities() - : ccCommandLineInterface::Command(QObject::tr("SELECT_ENTITIES"), COMMAND_SELECT_ENTITIES) + : ccCommandLineInterface::Command(QObject::tr("Select entities"), COMMAND_SELECT_ENTITIES) {} bool CommandSelectEntities::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[SELECT ENTITIES]")); - //option handling //look for additional parameters ccCommandLineInterface::SelectEntitiesOptions options; @@ -7343,7 +7249,6 @@ CommandClear::CommandClear() bool CommandClear::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[CLEAR]")); cmd.removeClouds(false); cmd.removeMeshes(false); return true; @@ -7355,18 +7260,16 @@ CommandClearClouds::CommandClearClouds() bool CommandClearClouds::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[CLEAR CLOUDS]")); cmd.removeClouds(false); return true; } CommandPopClouds::CommandPopClouds() - : ccCommandLineInterface::Command(QObject::tr("Pop clouds"), COMMAND_POP_CLOUDS) + : ccCommandLineInterface::Command(QObject::tr("Pop cloud"), COMMAND_POP_CLOUDS) {} bool CommandPopClouds::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[POP CLOUD]")); cmd.removeClouds(true); return true; } @@ -7377,18 +7280,16 @@ CommandClearMeshes::CommandClearMeshes() bool CommandClearMeshes::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[CLEAR MESHES]")); cmd.removeMeshes(false); return true; } CommandPopMeshes::CommandPopMeshes() - : ccCommandLineInterface::Command(QObject::tr("Pop meshes"), COMMAND_POP_MESHES) + : ccCommandLineInterface::Command(QObject::tr("Pop mesh"), COMMAND_POP_MESHES) {} bool CommandPopMeshes::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[POP MESH]")); cmd.removeMeshes(true); return true; } @@ -7453,8 +7354,6 @@ CommandFeature::CommandFeature() bool CommandFeature::process(ccCommandLineInterface& cmd) { - cmd.print(QObject::tr("[FEATURE]")); - if (cmd.arguments().empty()) { return cmd.error(QObject::tr("Missing parameter: feature type after \"-%1\"").arg(COMMAND_FEATURE)); @@ -7586,11 +7485,9 @@ CommandDebugCmdLine::CommandDebugCmdLine() bool CommandDebugCmdLine::process(ccCommandLineInterface& cmd) { - cmd.print("[DEBUG]"); - cmd.print("******************************************"); - cmd.print("Number of clouds: " + QString::number(cmd.clouds().size())); - cmd.print("Number of meshes: " + QString::number(cmd.meshes().size())); + cmd.print("Number of selected clouds: " + QString::number(cmd.clouds().size())); + cmd.print("Number of selected meshes: " + QString::number(cmd.meshes().size())); cmd.print("******************************************"); const QStringList& arguments = cmd.arguments(); @@ -7620,3 +7517,29 @@ bool CommandDebugCmdLine::process(ccCommandLineInterface& cmd) return true; } + +CommandSetVerbosity::CommandSetVerbosity() + : ccCommandLineInterface::Command(QObject::tr("Set Verbosity"), COMMAND_VERBOSITY) +{} + +bool CommandSetVerbosity::process(ccCommandLineInterface& cmd) +{ + if (cmd.arguments().empty()) + { + return cmd.error(QObject::tr("Missing parameter: verbosity level after: %1").arg(COMMAND_VERBOSITY)); + } + + bool ok = false; + int verbosityLevel = cmd.arguments().takeFirst().toInt(&ok); + if (!ok) + { + return cmd.error(QObject::tr("Invalid verbosity level %1").arg(verbosityLevel)); + } + else + { + cmd.print(QObject::tr("Set verbosity level to %1").arg(verbosityLevel)); + ccLog::SetVerbosityLevel(verbosityLevel); + } + + return true; +} diff --git a/qCC/ccCommandLineCommands.h b/qCC/ccCommandLineCommands.h index 22554fb9ec..450c951170 100644 --- a/qCC/ccCommandLineCommands.h +++ b/qCC/ccCommandLineCommands.h @@ -603,4 +603,11 @@ struct CommandDebugCmdLine : public ccCommandLineInterface::Command bool process(ccCommandLineInterface& cmd) override; }; +struct CommandSetVerbosity : public ccCommandLineInterface::Command +{ + CommandSetVerbosity(); + + bool process(ccCommandLineInterface& cmd) override; +}; + #endif //COMMAND_LINE_COMMANDS_HEADER diff --git a/qCC/ccCommandLineParser.cpp b/qCC/ccCommandLineParser.cpp index 59ca04945a..509ce0649e 100644 --- a/qCC/ccCommandLineParser.cpp +++ b/qCC/ccCommandLineParser.cpp @@ -36,11 +36,21 @@ constexpr char COMMAND_SILENT_MODE[] = "SILENT"; /*************** ccCommandLineParser *****************/ /*****************************************************/ +void ccCommandLineParser::printVerbose(const QString& message) const +{ + ccConsole::PrintVerbose(message); +} + void ccCommandLineParser::print(const QString& message) const { ccConsole::Print(message); } +void ccCommandLineParser::printHigh(const QString& message) const +{ + ccConsole::PrintHigh(message); +} + void ccCommandLineParser::printDebug(const QString& message) const { ccConsole::PrintDebug(message); @@ -556,7 +566,7 @@ void ccCommandLineParser::removeMeshes(bool onlyLast/*=false*/) bool ccCommandLineParser::importFile(QString filename, const GlobalShiftOptions& globalShiftOptions, FileIOFilter::Shared filter) { - print(QString("Opening file: '%1'").arg(filename)); + printHigh(QString("Opening file: '%1'").arg(filename)); //whether Global (coordinate) shift has already been defined static bool s_firstCoordinatesShiftEnabled = false; @@ -912,6 +922,7 @@ void ccCommandLineParser::registerBuiltInCommands() registerCommand(Command::Shared(new CommandFeature)); registerCommand(Command::Shared(new CommandRGBConvertToSF)); registerCommand(Command::Shared(new CommandFlipTriangles)); + registerCommand(Command::Shared(new CommandSetVerbosity)); } void ccCommandLineParser::cleanup() @@ -957,7 +968,12 @@ int ccCommandLineParser::start(QDialog* parent/*=nullptr*/) if (m_commands.contains(keyword)) { assert(m_commands[keyword]); + QElapsedTimer eTimerSubProcess; + eTimerSubProcess.start(); + QString processName = m_commands[keyword]->m_name.toUpper(); + printHigh(QString("[%1]").arg(processName)); success = m_commands[keyword]->process(*this); + printHigh(QString("[%2] finished in %1 s.").arg(eTimerSubProcess.elapsed() / 1.0e3, 0, 'f', 2).arg(processName)); } //silent mode (i.e. no console) else if (keyword == COMMAND_SILENT_MODE) diff --git a/qCC/ccCommandLineParser.h b/qCC/ccCommandLineParser.h index b190f4f881..b8ffb029f0 100644 --- a/qCC/ccCommandLineParser.h +++ b/qCC/ccCommandLineParser.h @@ -55,7 +55,9 @@ class ccCommandLineParser : public ccCommandLineInterface const QStringList& arguments() const override { return m_arguments; } bool registerCommand(Command::Shared command) override; QDialog* widgetParent() override { return m_parentWidget; } + void printVerbose(const QString& message) const override; void print(const QString& message) const override; + void printHigh(const QString& message) const override; void printDebug(const QString& message) const override; void warning(const QString& message) const override; void warningDebug(const QString& message) const override; diff --git a/qCC/ccConsole.cpp b/qCC/ccConsole.cpp index 71c8713084..469f4af338 100644 --- a/qCC/ccConsole.cpp +++ b/qCC/ccConsole.cpp @@ -294,11 +294,11 @@ void ccConsole::refresh() QListWidgetItem* item = new QListWidgetItem(messagePair.first); //set color based on the message severity - if (messagePair.second & LOG_ERROR) // Error + if ((messagePair.second & LOG_ERROR) == LOG_ERROR) // Error { item->setForeground(Qt::red); } - else if (messagePair.second & LOG_WARNING) // Warning + else if ((messagePair.second & LOG_WARNING) == LOG_WARNING) // Warning { item->setForeground(Qt::darkRed); //we also force the console visibility if a warning message arrives! @@ -308,7 +308,7 @@ void ccConsole::refresh() } } #ifdef QT_DEBUG - else if (messagePair.second & LOG_DEBUG) // Debug + else if (messagePair.second & DEBUG_FLAG) // Debug { item->setForeground(Qt::blue); } @@ -337,13 +337,11 @@ void ccConsole::refresh() void ccConsole::logMessage(const QString& message, int level) { -#ifndef QT_DEBUG - //skip debug messages in release mode - if (level & LOG_DEBUG) + //skip messages below the current 'verbosity' level + if ((level & 7) < ccLog::VerbosityLevel()) { return; } -#endif QString formatedMessage = QStringLiteral("[") + QTime::currentTime().toString() + QStringLiteral("] ") + message; if (s_redirectToStdOut) @@ -362,7 +360,7 @@ void ccConsole::logMessage(const QString& message, int level) //Error if (level & LOG_ERROR) { - if (level & LOG_DEBUG) + if (level & DEBUG_FLAG) printf("ERR-DBG: "); else printf("ERR: "); @@ -370,7 +368,7 @@ void ccConsole::logMessage(const QString& message, int level) //Warning else if (level & LOG_WARNING) { - if (level & LOG_DEBUG) + if (level & DEBUG_FLAG) printf("WARN-DBG: "); else printf("WARN: "); @@ -378,7 +376,7 @@ void ccConsole::logMessage(const QString& message, int level) //Standard else { - if (level & LOG_DEBUG) + if (level & DEBUG_FLAG) printf("MSG-DBG: "); else printf("MSG: "); diff --git a/qCC/main.cpp b/qCC/main.cpp index a767351c72..55927473df 100644 --- a/qCC/main.cpp +++ b/qCC/main.cpp @@ -108,14 +108,51 @@ int main(int argc, char **argv) if (commandLine) { //translation file selection - if (argumentsLocal8Bit[lastArgumentIndex].toUpper() == "-LANG") + if ( lastArgumentIndex < argumentsLocal8Bit.size() + && argumentsLocal8Bit[lastArgumentIndex].toUpper() == "-LANG") { - QString langFilename = argumentsLocal8Bit[2]; + //remove verified local option + argumentsLocal8Bit.removeAt(lastArgumentIndex); + + if (lastArgumentIndex >= argumentsLocal8Bit.size()) + { + ccLog::Error(QObject::tr("Missing argument after %1: language file").arg("-LANG")); + return EXIT_FAILURE; + } + + //remove verified arguments so that -SILENT will be the first one (if present)... + QString langFilename = argumentsLocal8Bit.takeAt(lastArgumentIndex); ccTranslationManager::Get().loadTranslation(langFilename); commandLine = false; - lastArgumentIndex += 2; } + + if ( lastArgumentIndex < argumentsLocal8Bit.size() + && argumentsLocal8Bit[lastArgumentIndex].toUpper() == "-VERBOSITY") + { + //remove verified local option + argumentsLocal8Bit.removeAt(lastArgumentIndex); + + if (lastArgumentIndex >= argumentsLocal8Bit.size()) + { + ccLog::Error(QObject::tr("Missing argument after %1: verbosity level").arg("-VERBOSITY")); + return EXIT_FAILURE; + } + + //remove verified arguments so that -SILENT will be the first one (if present)... + QString verbosityLevelStr = argumentsLocal8Bit.takeAt(lastArgumentIndex); + + bool ok = false; + int verbosityLevel = verbosityLevelStr.toInt(&ok); + if (!ok || verbosityLevel < 0) + { + ccLog::Warning(QObject::tr("Invalid verbosity level: %1").arg(verbosityLevelStr)); + } + else + { + ccLog::SetVerbosityLevel(verbosityLevel); + } + } } #ifdef Q_OS_WIN