From 64b3a44763550be0f6edde092b654236a5421d22 Mon Sep 17 00:00:00 2001 From: John Morrison Date: Fri, 15 Jun 2012 16:11:19 -0400 Subject: added rudimentry verbose logging support --- fly-tools/FlyTrackingMain.cpp | 30 +++++++++++++++++++++++++++--- 1 file 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 -o -f -m -O "; 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); -- cgit v1.2.3