Commit 22eaf416 authored by loring's avatar loring

debug log disambiguation

include source file and line number in debug log
reports


git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@26810 18c085ea-50e0-402c-830e-de6fd14e8384
parent 378f630e
......@@ -69,10 +69,10 @@ namespace DebugStream
extern MISC_API int GetLevel();
}
#define debug1 if (!DebugStream::Level1()) ; else (DebugStream::Stream1())
#define debug2 if (!DebugStream::Level2()) ; else (DebugStream::Stream2())
#define debug3 if (!DebugStream::Level3()) ; else (DebugStream::Stream3())
#define debug4 if (!DebugStream::Level4()) ; else (DebugStream::Stream4())
#define debug5 if (!DebugStream::Level5()) ; else (DebugStream::Stream5())
#define debug1 if (!DebugStream::Level1()) ; else (DebugStream::Stream1()) << __FILE__ << ":" << __LINE__ << " "
#define debug2 if (!DebugStream::Level2()) ; else (DebugStream::Stream2()) << __FILE__ << ":" << __LINE__ << " "
#define debug3 if (!DebugStream::Level3()) ; else (DebugStream::Stream3()) << __FILE__ << ":" << __LINE__ << " "
#define debug4 if (!DebugStream::Level4()) ; else (DebugStream::Stream4()) << __FILE__ << ":" << __LINE__ << " "
#define debug5 if (!DebugStream::Level5()) ; else (DebugStream::Stream5()) << __FILE__ << ":" << __LINE__ << " "
#endif
......@@ -54,6 +54,8 @@
#endif
#include <new>
#include <cstring>
#include <sstream>
using std::ostringstream;
#include <ConfigureInfo.h>
#include <DebugStreamFull.h>
......@@ -419,9 +421,11 @@ VisItInit::Initialize(int &argc, char *argv[], int r, int n, bool strip, bool si
// Initialize the debug streams and also add the command line arguments
// to the debug logs.
DebugStreamFull::Initialize(progname, debuglevel, sigs, clobberVlogs, bufferDebug);
ostringstream oss;
for(i = 0; i < argc; ++i)
debug1 << argv[i] << " ";
debug1 << endl;
oss << argv[i] << " ";
oss << endl;
debug1 << oss.str();
TimingsManager::Initialize(progname);
// In case TimingsManager was already initialized...
......
......@@ -382,8 +382,7 @@ void avtGGCMFileFormat::RegisterDataSelections(
debug4 << "RegisterDataSelections(";
if(sels.size() > 0) {
for(i=0; i < sels.size()-1; ++i) {
debug4 << sels[i]->GetType() << ", ";
debug4.flush();
debug4 << sels[i]->GetType() << ", " << std::flush;
}
debug4 << sels[i]->GetType() << ")" << std::endl;
} else {
......
......@@ -48,11 +48,11 @@ void dbstream_printf(int level, const char *fmt, ...) {
va_start(ap, fmt);
vsnprintf(buf,4095,fmt,ap);
va_end(ap);
if (level == 5) { debug5 << buf; debug5.flush(); }
if (level == 4) { debug4 << buf; debug4.flush(); }
if (level == 3) { debug3 << buf; debug3.flush(); }
if (level == 2) { debug2 << buf; debug2.flush(); }
if (level < 2) { debug1 << buf; debug1.flush(); }
if (level == 5) { debug5 << buf << std::flush; }
if (level == 4) { debug4 << buf << std::flush; }
if (level == 3) { debug3 << buf << std::flush; }
if (level == 2) { debug2 << buf << std::flush; }
if (level < 2) { debug1 << buf << std::flush; }
if (level == 0) cout << buf;
return;
}
......
......@@ -107,7 +107,7 @@ ChangeDirectoryRPCExecutor::Update(Subject *s)
ChangeDirectoryRPC *rpc = (ChangeDirectoryRPC *)s;
#ifdef DEBUG
debug2 << "ChangeDirectoryRPCExecutor::Update: dir="
<< rpc->GetDirectory().c_str() << "\n"; debug2.flush();
<< rpc->GetDirectory().c_str() << "\n" << std::flush;
#endif
// Either send a successful reply or send an error.
if(parent->ChangeDirectory(rpc->GetDirectory()) == 0)
......
......@@ -105,7 +105,7 @@ ExpandPathRPCExecutor::Update(Subject *s)
ExpandPathRPC *rpc = (ExpandPathRPC *)s;
#ifdef DEBUG
debug2 << "ExpandPathRPCExecutor::Update: dir="
<< rpc->GetPath().c_str() << "\n"; debug2.flush();
<< rpc->GetPath().c_str() << "\n" << std::flush;
#endif
// Either send a successful reply or send an error.
ExpandPathRPC::PathName path;
......
......@@ -107,8 +107,7 @@ GetDBPluginInfoRPCExecutor::Update(Subject *s)
{
GetDBPluginInfoRPC *rpc = (GetDBPluginInfoRPC *)s;
debug2 << "GetDBPluginInfoRPCExecutor::Update\n";
debug2.flush();
debug2 << "GetDBPluginInfoRPCExecutor::Update\n" << std::flush;
TRY
{
......
......@@ -108,7 +108,7 @@ GetDirectoryRPCExecutor::Update(Subject *s)
{
GetDirectoryRPC *rpc = (GetDirectoryRPC *)s;
#ifdef DEBUG
debug2 << "GetDirectoryRPCExecutor::Update\n"; debug2.flush();
debug2 << "GetDirectoryRPCExecutor::Update\n" << std::flush;
#endif
GetDirectoryRPC::DirectoryName dir;
dir.name = parent->GetCurrentWorkingDirectory();
......
......@@ -122,7 +122,7 @@ GetFileListRPCExecutor::Update(Subject *s)
int total = visitTimer->StartTimer();
GetFileListRPC *rpc = (GetFileListRPC *)s;
debug2 << "GetFileListRPCExecutor::Update\n"; debug2.flush();
debug2 << "GetFileListRPCExecutor::Update\n" << std::flush;
// Either send a successful reply or send an error.
if(parent->GetReadFileListReturnValue() == 0)
......@@ -135,8 +135,7 @@ GetFileListRPCExecutor::Update(Subject *s)
rpc->GetSmartFileGrouping());
parent->GetFilteredFileList(files);
debug4 << "FILELIST=" << files << endl;
debug4.flush();
debug4 << "FILELIST=" << files << endl << std::flush;
rpc->SendReply(&files);
}
else
......@@ -145,8 +144,7 @@ GetFileListRPCExecutor::Update(Subject *s)
if (files == NULL)
debug4 << "FILELIST is NULL!" << endl;
else
debug4 << "FILELIST=" << *files << endl;
debug4.flush();
debug4 << "FILELIST=" << *files << endl << std::flush;
rpc->SendReply(files);
}
......
......@@ -149,8 +149,7 @@ GetMetaDataRPCExecutor::Update(Subject *s)
debug2 << "GetMetaDataRPCExecutor::Update - file="
<< rpc->GetFile().c_str() << " type="
<< rpc->GetForcedFileType() << "\n";
debug2.flush();
<< rpc->GetForcedFileType() << "\n" << std::flush;
TRY
{
......
......@@ -122,8 +122,7 @@ GetSILRPCExecutor::Update(Subject *s)
int t1 = visitTimer->StartTimer();
GetSILRPC *rpc = (GetSILRPC *)s;
debug2 << "GetSILRPCExecutor::Update - file="<<rpc->GetFile().c_str()<<"\n";
debug2.flush();
debug2 << "GetSILRPCExecutor::Update - file="<<rpc->GetFile().c_str()<<"\n" << std::flush;
TRY
{
......
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