Commit 76e4efec authored by miller86's avatar miller86

Making __FILE__/__LINE__ decoration of debug logs optional

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@27146 18c085ea-50e0-402c-830e-de6fd14e8384
parent 5747d93f
......@@ -72,6 +72,7 @@ void ViewerProperties::Init()
forceSSHTunneling = false;
inExecute = false;
inLaunch = false;
decorateDebug = false;
ViewerProperties::SelectAll();
}
......@@ -117,6 +118,7 @@ void ViewerProperties::Copy(const ViewerProperties &obj)
forceSSHTunneling = obj.forceSSHTunneling;
inExecute = obj.inExecute;
inLaunch = obj.inLaunch;
decorateDebug = obj.decorateDebug;
ViewerProperties::SelectAll();
}
......@@ -297,7 +299,8 @@ ViewerProperties::operator == (const ViewerProperties &obj) const
(bufferDebug == obj.bufferDebug) &&
(forceSSHTunneling == obj.forceSSHTunneling) &&
(inExecute == obj.inExecute) &&
(inLaunch == obj.inLaunch));
(inLaunch == obj.inLaunch) &&
(decorateDebug == obj.decorateDebug));
}
// ****************************************************************************
......@@ -465,6 +468,7 @@ ViewerProperties::SelectAll()
Select(ID_forceSSHTunneling, (void *)&forceSSHTunneling);
Select(ID_inExecute, (void *)&inExecute);
Select(ID_inLaunch, (void *)&inLaunch);
Select(ID_decorateDebug, (void *)&decorateDebug);
}
///////////////////////////////////////////////////////////////////////////////
......@@ -639,6 +643,13 @@ ViewerProperties::SetInLaunch(bool inLaunch_)
Select(ID_inLaunch, (void *)&inLaunch);
}
void
ViewerProperties::SetDecorateDebug(bool decorateDebug_)
{
decorateDebug = decorateDebug_;
Select(ID_decorateDebug, (void *)&decorateDebug);
}
///////////////////////////////////////////////////////////////////////////////
// Get property methods
///////////////////////////////////////////////////////////////////////////////
......@@ -841,6 +852,12 @@ ViewerProperties::GetInLaunch() const
return inLaunch;
}
bool
ViewerProperties::GetDecorateDebug() const
{
return decorateDebug;
}
///////////////////////////////////////////////////////////////////////////////
// Select property methods
///////////////////////////////////////////////////////////////////////////////
......
......@@ -121,6 +121,7 @@ public:
void SetForceSSHTunneling(bool forceSSHTunneling_);
void SetInExecute(bool inExecute_);
void SetInLaunch(bool inLaunch_);
void SetDecorateDebug(bool decorateDebug_);
// Property getting methods
bool GetMasterProcess() const;
......@@ -156,6 +157,7 @@ public:
bool GetForceSSHTunneling() const;
bool GetInExecute() const;
bool GetInLaunch() const;
bool GetDecorateDebug() const;
// IDs that can be used to identify fields in case statements
......@@ -184,6 +186,7 @@ public:
ID_forceSSHTunneling,
ID_inExecute,
ID_inLaunch,
ID_decorateDebug,
ID__LAST
};
......@@ -212,11 +215,12 @@ private:
bool forceSSHTunneling;
bool inExecute;
bool inLaunch;
bool decorateDebug;
// Static class format string for type map.
static const char *TypeMapFormatString;
static const private_tmfs_t TmfsStruct;
};
#define VIEWERPROPERTIES_TMFS "bbssssibbbbssbbis*s*s*ibbbb"
#define VIEWERPROPERTIES_TMFS "bbssssibbbbssbbis*s*s*ibbbbb"
#endif
......@@ -64,4 +64,7 @@
<Field name="inLaunch" label="In Launch" type="bool">
false
</Field>
<Field name="decorateDebug" label="Decorate level 1 debug logs with __FILE__ and __LINE__" type="bool">
false
</Field>
</Attribute>
......@@ -274,11 +274,13 @@ ViewerServerManager::AddArguments(RemoteProxyBase *component,
// Add arguments to the mdserver.
if(GetViewerProperties()->GetDebugLevel() > 0)
{
char const *bufferDebug = "b";
char const *decorateDebug = "d";
char temp[10];
if (GetViewerProperties()->GetBufferDebug())
SNPRINTF(temp, 10, "%db", GetViewerProperties()->GetDebugLevel());
else
SNPRINTF(temp, 10, "%d", GetViewerProperties()->GetDebugLevel());
SNPRINTF(temp, 10, "%d%s%s",
GetViewerProperties()->GetDebugLevel(),
GetViewerProperties()->GetBufferDebug()?bufferDebug:"",
GetViewerProperties()->GetDecorateDebug()?decorateDebug:"");
component->AddArgument("-debug");
component->AddArgument(temp);
}
......
......@@ -2448,18 +2448,23 @@ ViewerSubject::ProcessCommandLine(int argc, char **argv)
{
int debugLevel = 1;
bool bufferDebug = false;
bool decorateDebug = false;
if (i+1 < argc && isdigit(*(argv[i+1])))
debugLevel = atoi(argv[i+1]);
else
cerr << "Warning: debug level not specified, assuming 1" << endl;
if (i+1 < argc && *(argv[i+1]+1) == 'b')
if (i+1 < argc && strchr(argv[i+1],'b'))
bufferDebug = true;
if (i+1 < argc && strchr(argv[i+1],'d'))
decorateDebug = true;
if (debugLevel > 0 && debugLevel < 6)
{
GetViewerProperties()->SetDebugLevel(debugLevel);
GetViewerProperties()->SetBufferDebug(bufferDebug);
GetViewerProperties()->SetDecorateDebug(decorateDebug);
clientArguments.push_back(argv[i]);
clientArguments.push_back(argv[i+1]);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment