X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=progress.cpp;h=ff93b348e521009fac30e72bc3e0c34f46327400;hb=1a968f34ae2d2680eaf189a197d1a21b8dfd6c03;hp=6899e76e1940e2408567ce0e7212a7315266f143;hpb=510b1cfc25cd79391d6973ca20c5ec25fb1bb3b2;p=mothur.git diff --git a/progress.cpp b/progress.cpp index 6899e76..ff93b34 100644 --- a/progress.cpp +++ b/progress.cpp @@ -18,13 +18,14 @@ const char marker = '|'; Progress::Progress(){ try { - mothurOut("********************#****#****#****#****#****#****#****#****#****#****#"); + m = MothurOut::getInstance(); + m->mothurOut("********************#****#****#****#****#****#****#****#****#****#****#"); nTicks = 0; finalPos = 0; } catch(exception& e) { - errorOut(e, "Progress", "Progress"); + m->errorOut(e, "Progress", "Progress"); exit(1); } } @@ -33,17 +34,20 @@ Progress::Progress(){ Progress::Progress(string job, int end){ try { - mothurOut("********************#****#****#****#****#****#****#****#****#****#****#\n"); + m = MothurOut::getInstance(); + + m->mothurOut("********************#****#****#****#****#****#****#****#****#****#****#\n"); cout << setw(20) << left << job << setw(1) << marker; - mothurOutJustToLog(job); - mothurOut(toString(marker)); + m->mothurOutJustToLog(job); + m->mothurOut(toString(marker)); cout.flush(); nTicks = 0; finalPos = end; + } catch(exception& e) { - errorOut(e, "Progress", "Progress"); + m->errorOut(e, "Progress", "Progress"); exit(1); } } @@ -52,17 +56,17 @@ Progress::Progress(string job, int end){ void Progress::newLine(string job, int end){ try { - mothurOutEndLine(); + m->mothurOutEndLine(); cout << setw(20) << left << job << setw(1) << marker; - mothurOutJustToLog(job); - mothurOut(toString(marker)); + m->mothurOutJustToLog(job); + m->mothurOut(toString(marker)); cout.flush(); nTicks = 0; finalPos = end; } catch(exception& e) { - errorOut(e, "Progress", "newLine"); + m->errorOut(e, "Progress", "newLine"); exit(1); } } @@ -75,14 +79,14 @@ void Progress::update(const int currentPos){ if(ratio > nTicks){ for(int i=nTicks;imothurOut(toString(marker)); cout.flush(); } nTicks = ratio; } } catch(exception& e) { - errorOut(e, "Progress", "update"); + m->errorOut(e, "Progress", "update"); exit(1); } } @@ -92,17 +96,17 @@ void Progress::update(const int currentPos){ void Progress::finish(){ try { for(int i=nTicks;imothurOut(toString(marker)); cout.flush(); } - mothurOutEndLine(); - mothurOut("***********************************************************************\n"); + m->mothurOutEndLine(); + m->mothurOut("***********************************************************************\n"); cout.flush(); } catch(exception& e) { - errorOut(e, "Progress", "finish"); + m->errorOut(e, "Progress", "finish"); exit(1); } }