diff options
author | John Morrison <jcm357@cs.drexel.edu> | 2012-06-15 16:11:19 -0400 |
---|---|---|
committer | John Morrison <jcm357@cs.drexel.edu> | 2012-06-15 16:11:19 -0400 |
commit | 64b3a44763550be0f6edde092b654236a5421d22 (patch) | |
tree | c64b72c7889b523f5293e9c8b8c90546b3dba0d8 /fly-tools | |
parent | bc5e8a9c4f9c6530793037b19d045fc10581823e (diff) |
added rudimentry verbose logging support
Diffstat (limited to 'fly-tools')
-rw-r--r-- | fly-tools/FlyTrackingMain.cpp | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/fly-tools/FlyTrackingMain.cpp b/fly-tools/FlyTrackingMain.cpp index 381722e..09b4010 100644 --- a/fly-tools/FlyTrackingMain.cpp +++ b/fly-tools/FlyTrackingMain.cpp @@ -2022,13 +2022,26 @@ ofstream foutSt; ofstream foutDebugCen; ofstream foutDebugSpeed; +typedef void (*loggerfunc) (const string&); + +void logOn(const string& toprint){ + cout << toprint << endl; +} + +void logOff(const string& toprint){ +} + +loggerfunc vlog = NULL; + int main(int argc, char **argv) { + int c; + bool verbose = false; string usage = "Usage: FlyTracking -i <inputFile.txt> -o <originalImagePath> -f <finalOutputPath> -m <maskImagePath> -O <outputFilePrefix>"; opterr = 0; - while ((c = getopt (argc, argv, "i:f:m:p:o:hx")) != -1) + while ((c = getopt (argc, argv, "i:f:m:p:o:hxv")) != -1) switch (c) { case 'i': @@ -2053,13 +2066,24 @@ int main(int argc, char **argv) case 'x': writeFinalImages = true; break; - default: + case 'v': + verbose = true; + break; + default: break; } //MagickCore::SetMagickResourceLimit(MagickCore::MemoryResource, 1536); //MagickCore::SetMagickResourceLimit(MagickCore::MapResource, 4092); - + if(verbose) { + vlog = &logOn; + } else { + vlog = &logOff; + } + + vlog("verbose logging out"); + + exit(0); if( inputFileName.empty() || origImagePath.empty() || finalOutputPath.empty() || maskImagePath.empty() || outputFilePrefix.empty() ) { cerr << usage << endl; exit(1); |