[bos #32517][EDF] Dynamic logging: Removed MYDEBUG.

This commit is contained in:
Konstantin LEONTEV 2022-10-12 21:05:25 +03:00
parent f932f85c16
commit 2ea018379d
3 changed files with 36 additions and 47 deletions

View File

@ -83,13 +83,6 @@
#define C_SQR_BRACKET ']' #define C_SQR_BRACKET ']'
#define PY_NULL "None" #define PY_NULL "None"
#ifdef _DEBUG_
static int MYDEBUG = 0;
using namespace std;
#else
static int MYDEBUG = 0;
#endif
// VSR 29/08/2017: 0023327, 0023428: eliminate unnecessary lines in Python dump // VSR 29/08/2017: 0023327, 0023428: eliminate unnecessary lines in Python dump
// Next macro, when defined, causes appearing of SubShapeAllIDs(), SubShapeAllSortedIDs(), GetSameIDs() // Next macro, when defined, causes appearing of SubShapeAllIDs(), SubShapeAllSortedIDs(), GetSameIDs()
// and other such commands in Python dump. // and other such commands in Python dump.
@ -1302,10 +1295,10 @@ Handle(TColStd_HSequenceOfInteger) FindEntries(TCollection_AsciiString& theStrin
void ReplaceVariables(TCollection_AsciiString& theCommand, void ReplaceVariables(TCollection_AsciiString& theCommand,
const TVariablesList& theVariables) const TVariablesList& theVariables)
{ {
if (MYDEBUG) if (SALOME::VerbosityActivated())
std::cout<<"Command : "<<theCommand<<std::endl; std::cout<<"Command : "<<theCommand<<std::endl;
if (MYDEBUG) { if (SALOME::VerbosityActivated()) {
std::cout<<"All Entries:"<<std::endl; std::cout<<"All Entries:"<<std::endl;
TVariablesList::const_iterator it = theVariables.begin(); TVariablesList::const_iterator it = theVariables.begin();
for(;it != theVariables.end();it++) for(;it != theVariables.end();it++)
@ -1319,7 +1312,7 @@ void ReplaceVariables(TCollection_AsciiString& theCommand,
if( aCommand.Length() == 0 ) if( aCommand.Length() == 0 )
break; break;
if (MYDEBUG) if (SALOME::VerbosityActivated())
std::cout<<"Sub-command : "<<aCommand<<std::endl; std::cout<<"Sub-command : "<<aCommand<<std::endl;
Standard_Integer aStartCommandPos = theCommand.Location(aCommand,1,theCommand.Length()); Standard_Integer aStartCommandPos = theCommand.Location(aCommand,1,theCommand.Length());
@ -1337,7 +1330,7 @@ void ReplaceVariables(TCollection_AsciiString& theCommand,
//Remove white spaces //Remove white spaces
anEntry.RightAdjust(); anEntry.RightAdjust();
anEntry.LeftAdjust(); anEntry.LeftAdjust();
if(MYDEBUG) if(SALOME::VerbosityActivated())
std::cout<<"Result entry : '" <<anEntry<<"'"<<std::endl; std::cout<<"Result entry : '" <<anEntry<<"'"<<std::endl;
if ( anEntry.IsEmpty() ) { if ( anEntry.IsEmpty() ) {
@ -1355,8 +1348,8 @@ void ReplaceVariables(TCollection_AsciiString& theCommand,
anEntry.Remove( 1, 1 ); anEntry.Remove( 1, 1 );
anEntry.RightAdjust(); anEntry.RightAdjust();
anEntry.LeftAdjust(); anEntry.LeftAdjust();
if(MYDEBUG) if(SALOME::VerbosityActivated())
std::cout<<"Sub-entry : '" <<anEntry<<"'"<<std::endl; std::cout<<"Sub-entry : '" <<anEntry<<"'"<<std::endl;
} }
//Find variables used for object construction //Find variables used for object construction
@ -1366,15 +1359,15 @@ void ReplaceVariables(TCollection_AsciiString& theCommand,
aStates = (*it).second; aStates = (*it).second;
if(!aStates) { if(!aStates) {
if(MYDEBUG) if(SALOME::VerbosityActivated())
std::cout<<"Valiables list empty!!!"<<std::endl; std::cout<<"Valiables list empty!!!"<<std::endl;
aCommandIndex++; aCommandIndex++;
continue; continue;
} }
TState aVariables = aStates->GetCurrectState(); TState aVariables = aStates->GetCurrectState();
if(MYDEBUG) { if(SALOME::VerbosityActivated()) {
std::cout<<"Variables from SObject:"<<std::endl; std::cout<<"Variables from SObject:"<<std::endl;
for (size_t i = 0; i < aVariables.size();i++) for (size_t i = 0; i < aVariables.size();i++)
std::cout<<"\t Variable["<<i<<"] = "<<aVariables[i].myVariable<<std::endl; std::cout<<"\t Variable["<<i<<"] = "<<aVariables[i].myVariable<<std::endl;
@ -1385,8 +1378,8 @@ void ReplaceVariables(TCollection_AsciiString& theCommand,
while(aCommand.Location(aTotalNbParams,COMMA,1,aCommand.Length())) while(aCommand.Location(aTotalNbParams,COMMA,1,aCommand.Length()))
aTotalNbParams++; aTotalNbParams++;
if(MYDEBUG) if(SALOME::VerbosityActivated())
std::cout<<"aTotalNbParams = "<<aTotalNbParams<<std::endl; std::cout<<"aTotalNbParams = "<<aTotalNbParams<<std::endl;
Standard_Integer aFirstParam = aNbEntries; Standard_Integer aFirstParam = aNbEntries;
@ -1427,14 +1420,14 @@ void ReplaceVariables(TCollection_AsciiString& theCommand,
if ( aStartPos == aEndPos ) if ( aStartPos == aEndPos )
continue; // PAL20889: for "[]" continue; // PAL20889: for "[]"
if(MYDEBUG) if(SALOME::VerbosityActivated())
std::cout<<"aStartPos = "<<aStartPos<<", aEndPos = "<<aEndPos<<std::endl; std::cout<<"aStartPos = "<<aStartPos<<", aEndPos = "<<aEndPos<<std::endl;
aVar = aCommand.SubString(aStartPos, aEndPos-1); aVar = aCommand.SubString(aStartPos, aEndPos-1);
aVar.RightAdjust(); aVar.RightAdjust();
aVar.LeftAdjust(); aVar.LeftAdjust();
if(MYDEBUG) if(SALOME::VerbosityActivated())
std::cout<<"Variable: '"<< aVar <<"'"<<std::endl; std::cout<<"Variable: '"<< aVar <<"'"<<std::endl;
// specific case for sketcher // specific case for sketcher
@ -1454,8 +1447,8 @@ void ReplaceVariables(TCollection_AsciiString& theCommand,
aEndSectionPos = aVar.Length(); aEndSectionPos = aVar.Length();
aSection = aVar.SubString(aStartSectionPos, aEndSectionPos-1); aSection = aVar.SubString(aStartSectionPos, aEndSectionPos-1);
if(MYDEBUG) if(SALOME::VerbosityActivated())
std::cout<<"aSection: "<<aSection<<std::endl; std::cout<<"aSection: "<<aSection<<std::endl;
Standard_Integer aNbParams = 1; Standard_Integer aNbParams = 1;
while( aSection.Location( aNbParams, ' ', 1, aSection.Length() ) ) while( aSection.Location( aNbParams, ' ', 1, aSection.Length() ) )
@ -1471,15 +1464,15 @@ void ReplaceVariables(TCollection_AsciiString& theCommand,
else else
aEndParamPos = aSection.Length() + 1; aEndParamPos = aSection.Length() + 1;
if(MYDEBUG) if(SALOME::VerbosityActivated())
std::cout<<"aParamIndex: "<<aParamIndex<<" aStartParamPos: " <<aStartParamPos<<" aEndParamPos: "<<aEndParamPos<<std::endl; std::cout<<"aParamIndex: "<<aParamIndex<<" aStartParamPos: " <<aStartParamPos<<" aEndParamPos: "<<aEndParamPos<<std::endl;
if ( aStartParamPos == aEndParamPos) if ( aStartParamPos == aEndParamPos)
continue; continue;
aParameter = aSection.SubString(aStartParamPos, aEndParamPos-1); aParameter = aSection.SubString(aStartParamPos, aEndParamPos-1);
if(MYDEBUG) if(SALOME::VerbosityActivated())
std::cout<<"aParameter: "<<aParameter<<std::endl; std::cout<<"aParameter: "<<aParameter<<std::endl;
if(iVar >= aVariables.size()) if(iVar >= aVariables.size())
continue; continue;
@ -1495,27 +1488,30 @@ void ReplaceVariables(TCollection_AsciiString& theCommand,
aReplacedParameter.InsertAfter(aReplacedParameter.Length(),"'"); aReplacedParameter.InsertAfter(aReplacedParameter.Length(),"'");
} }
if(MYDEBUG) if(SALOME::VerbosityActivated())
std::cout<<"aSection before : "<<aSection<< std::endl; std::cout<<"aSection before : "<<aSection<< std::endl;
aSection.Remove(aStartParamPos, aEndParamPos - aStartParamPos); aSection.Remove(aStartParamPos, aEndParamPos - aStartParamPos);
aSection.Insert(aStartParamPos, aReplacedParameter); aSection.Insert(aStartParamPos, aReplacedParameter);
if(MYDEBUG) if(SALOME::VerbosityActivated())
std::cout<<"aSection after : "<<aSection<<std::endl<<std::endl; std::cout<<"aSection after : "<<aSection<<std::endl<<std::endl;
iVar++; iVar++;
} }
if(MYDEBUG)
if(SALOME::VerbosityActivated())
std::cout<<"aVar before : "<<aVar<<std::endl; std::cout<<"aVar before : "<<aVar<<std::endl;
aVar.Remove(aStartSectionPos, aEndSectionPos - aStartSectionPos); aVar.Remove(aStartSectionPos, aEndSectionPos - aStartSectionPos);
aVar.Insert(aStartSectionPos, aSection); aVar.Insert(aStartSectionPos, aSection);
if(MYDEBUG)
if(SALOME::VerbosityActivated())
std::cout<<"aVar after : "<<aVar<<std::endl<<std::endl; std::cout<<"aVar after : "<<aVar<<std::endl<<std::endl;
} }
if(MYDEBUG) if(SALOME::VerbosityActivated())
std::cout<<"aCommand before : "<<aCommand<<std::endl; std::cout<<"aCommand before : "<<aCommand<<std::endl;
aCommand.Remove(aStartPos, aEndPos - aStartPos); aCommand.Remove(aStartPos, aEndPos - aStartPos);
aCommand.Insert(aStartPos, aVar); aCommand.Insert(aStartPos, aVar);
if(MYDEBUG) if(SALOME::VerbosityActivated())
std::cout<<"aCommand after : "<<aCommand<<std::endl; std::cout<<"aCommand after : "<<aCommand<<std::endl;
break; break;
@ -1552,7 +1548,7 @@ void ReplaceVariables(TCollection_AsciiString& theCommand,
aStates->IncrementState(); aStates->IncrementState();
} }
if (MYDEBUG) if (SALOME::VerbosityActivated())
std::cout<<"Command : "<<theCommand<<std::endl; std::cout<<"Command : "<<theCommand<<std::endl;
} }

View File

@ -19,6 +19,7 @@
#include "GEOMUtils_XmlHandler.hxx" #include "GEOMUtils_XmlHandler.hxx"
#include <Basics_Utils.hxx> #include <Basics_Utils.hxx>
#include "utilities.h"
#include <libxml/parser.h> #include <libxml/parser.h>
#include <algorithm> #include <algorithm>
@ -30,8 +31,6 @@
#include <unistd.h> #include <unistd.h>
#endif #endif
//#define MYDEBUG
namespace namespace
{ {
const char* env_var = "GEOM_PluginsList"; const char* env_var = "GEOM_PluginsList";
@ -186,7 +185,6 @@ namespace
return xmlPaths; return xmlPaths;
} }
#ifdef MYDEBUG
void dumpinfo(const GEOMUtils::PluginInfo& info) void dumpinfo(const GEOMUtils::PluginInfo& info)
{ {
printf("DUMPING PLUGIN INFO\n"); printf("DUMPING PLUGIN INFO\n");
@ -210,7 +208,6 @@ namespace
printf("-----\n"); printf("-----\n");
} }
} }
#endif
} }
namespace GEOMUtils namespace GEOMUtils
@ -284,9 +281,10 @@ namespace GEOMUtils
//xmlCleanupParser();//vsr: xmlCleanupParser should not be called from the application //xmlCleanupParser();//vsr: xmlCleanupParser should not be called from the application
} // end xml doc } // end xml doc
} }
#ifdef MYDEBUG
dumpinfo(info); if (SALOME::VerbosityActivated())
#endif dumpinfo(info);
return info; return info;
} }
} }

View File

@ -73,10 +73,6 @@
//vtkStandardNewMacro(GEOM_Actor) //vtkStandardNewMacro(GEOM_Actor)
#ifndef MYDEBUG
//#define MYDEBUG
#endif
GEOM_Actor::GEOM_Actor(): GEOM_Actor::GEOM_Actor():
isOnlyVertex(false), isOnlyVertex(false),
@ -127,9 +123,8 @@ GEOM_Actor::GEOM_Actor():
// defined in this class !!! // defined in this class !!!
myPolyDataMapper(GEOM_PainterPolyDataMapper::New(),true) myPolyDataMapper(GEOM_PainterPolyDataMapper::New(),true)
{ {
#ifdef MYDEBUG
MESSAGE (this<< " GEOM_Actor::GEOM_Actor"); MESSAGE(this<< " GEOM_Actor::GEOM_Actor");
#endif
myPolyDataMapper->SetInputConnection(myAppendFilter->GetOutputPort()); myPolyDataMapper->SetInputConnection(myAppendFilter->GetOutputPort());
vtkProperty* aProperty; vtkProperty* aProperty;