]> git.donarmstrong.com Git - mothur.git/blobdiff - progress.cpp
changed random forest output filename
[mothur.git] / progress.cpp
index 6899e76e1940e2408567ce0e7212a7315266f143..ff93b348e521009fac30e72bc3e0c34f46327400 100644 (file)
@@ -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;i<ratio;i++){
-                               mothurOut(toString(marker));
+                               m->mothurOut(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;i<totalTicks;i++){
-                       mothurOut(toString(marker));
+                       m->mothurOut(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);
        }
 }