From a82e392338cfa00459a00464862675da07acb849 Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Wed, 16 Nov 2011 11:24:25 +0100 Subject: [PATCH] new debug level 3, update to debug level --- FDTD/operator_cylindermultigrid.cpp | 3 ++- openems.cpp | 2 +- tools/global.cpp | 8 +++++++- tools/global.h | 10 +++++++++- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/FDTD/operator_cylindermultigrid.cpp b/FDTD/operator_cylindermultigrid.cpp index f8ecee5..d406c5a 100644 --- a/FDTD/operator_cylindermultigrid.cpp +++ b/FDTD/operator_cylindermultigrid.cpp @@ -88,7 +88,8 @@ bool Operator_CylinderMultiGrid::SetupCSXGrid(CSRectGrid* grid) if (m_Split_Rad < discLines[0][n]) { m_Split_Pos = n; - cout << "Operator_CylinderMultiGrid::SetupCSXGrid: Found mesh split position @" << m_Split_Pos << endl; + if (g_settings.GetVerboseLevel()>0) + cout << "Operator_CylinderMultiGrid::SetupCSXGrid: Found mesh split position @" << m_Split_Pos << endl; m_Split_Rad = discLines[0][n]; break; } diff --git a/openems.cpp b/openems.cpp index bb14ce3..846c1e9 100644 --- a/openems.cpp +++ b/openems.cpp @@ -602,7 +602,7 @@ int openEMS::SetupFDTD(const char* file) // return(-2); } - if (g_settings.GetVerboseLevel()>1) + if (g_settings.GetVerboseLevel()>2) m_CSX->ShowPropertyStatus(cerr); if (CylinderCoords) diff --git a/tools/global.cpp b/tools/global.cpp index cd1cd36..3e97fac 100644 --- a/tools/global.cpp +++ b/tools/global.cpp @@ -35,7 +35,7 @@ void Global::ShowArguments(ostream& ostr, string front) { ostr << front << "--showProbeDiscretization\tShow probe discretization information" << endl; ostr << front << "--nativeFieldDumps\t\tDump all fields using the native field components" << endl; - ostr << front << "-v(v)\t\t\t\tSet debug level to 1(2)" << endl; + ostr << front << "-v,-vv,-vvv\t\t\tSet debug level: 1 to 3" << endl; } //! \brief This function initializes the object @@ -68,5 +68,11 @@ bool Global::parseCommandLineArgument( const char *argv ) m_VerboseLevel = 2; return true; } + else if (strcmp(argv,"-vvv")==0) + { + cout << "openEMS - verbose level 3" << endl; + m_VerboseLevel = 3; + return true; + } return false; } diff --git a/tools/global.h b/tools/global.h index 947cc4d..e85818b 100644 --- a/tools/global.h +++ b/tools/global.h @@ -37,13 +37,21 @@ public: void ShowArguments(std::ostream& ostr, std::string front=std::string()); - void SetVerboseLevel(int level) {m_VerboseLevel=level;} + //! Set the verbose level + void SetVerboseLevel(int level) {m_VerboseLevel=level;m_SavedVerboseLevel=level;} + //! Get the verbose level int GetVerboseLevel() const {return m_VerboseLevel;} + //! Set a new verbose level temporarily, restore it with RestoreVerboseLevel() + void SetTempVerboseLevel(int level) {m_SavedVerboseLevel=m_VerboseLevel;m_VerboseLevel=level;} + //! Restore the temporarily overwritten verbose level + void RestoreVerboseLevel() {m_VerboseLevel=m_SavedVerboseLevel;} + protected: bool m_showProbeDiscretization; bool m_nativeFieldDumps; int m_VerboseLevel; + int m_SavedVerboseLevel; }; extern Global g_settings;