5 * Created by westcott on 2/25/10.
6 * Copyright 2010 Schloss Lab. All rights reserved.
10 #include "mothurout.h"
12 /******************************************************/
13 MothurOut* MothurOut::getInstance() {
14 if( _uniqueInstance == 0) {
15 _uniqueInstance = new MothurOut();
17 return _uniqueInstance;
19 /*********************************************************************************************/
20 void MothurOut::setFileName(string filename) {
22 logFileName = filename;
23 openOutputFile(filename, out);
26 errorOut(e, "MothurOut", "setFileName");
30 /*********************************************************************************************/
31 MothurOut::~MothurOut() {
37 errorOut(e, "MothurOut", "MothurOut");
42 /*********************************************************************************************/
43 void MothurOut::mothurOut(string output) {
51 errorOut(e, "MothurOut", "MothurOut");
55 /*********************************************************************************************/
56 void MothurOut::mothurOutEndLine() {
62 errorOut(e, "MothurOut", "MothurOutEndLine");
66 /*********************************************************************************************/
67 void MothurOut::mothurOutJustToLog(string output) {
72 errorOut(e, "MothurOut", "MothurOutJustToLog");
76 /*********************************************************************************************/
77 void MothurOut::errorOut(exception& e, string object, string function) {
79 mothurOut(toString(e.what()));
80 mothurOut(" has occurred in the " + object + " class function " + function + ". Please contact Pat Schloss at mothur.bugs@gmail.com, and be sure to include the mothur.logFile with your inquiry.");
83 /*********************************************************************************************/