Index: src/parser.cpp
===================================================================
--- src/parser.cpp	(revision 58ed4a7c2bc8ff58164d0438ee813b30de7a34da)
+++ src/parser.cpp	(revision 632bc3e6a3aa135a6299c878abd3a7b67f1b355c)
@@ -32,5 +32,5 @@
   if (input == NULL) {
     if (!test)
-      Log() << Verbose(0) << endl << "Unable to open " << filename << ", is the directory correct?" << endl;
+      DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << filename << ", is the directory correct?" << endl);
     return false;
   }
@@ -109,7 +109,7 @@
 bool MatrixContainer::InitialiseIndices(class MatrixContainer *Matrix) 
 {
-  Log() << Verbose(0) << "Initialising indices";
+  DoLog(0) && (Log() << Verbose(0) << "Initialising indices");
   if (Matrix == NULL) {
-    Log() << Verbose(0) << " with trivial mapping." << endl;
+    DoLog(0) && (Log() << Verbose(0) << " with trivial mapping." << endl);
     Indices = Malloc<int*>(MatrixCounter + 1, "MatrixContainer::InitialiseIndices: **Indices");
     for(int i=MatrixCounter+1;i--;) {
@@ -119,5 +119,5 @@
     }
   } else {
-    Log() << Verbose(0) << " from other MatrixContainer." << endl;
+    DoLog(0) && (Log() << Verbose(0) << " from other MatrixContainer." << endl);
     if (MatrixCounter != Matrix->MatrixCounter)
       return false;
@@ -269,5 +269,5 @@
   input.open(file.str().c_str(), ios::in);
   if (input == NULL) {
-    Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl;
+    DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl);
     return false;
   }
@@ -278,7 +278,7 @@
   }
   input.close();
-  Log() << Verbose(0) << "Determined " << MatrixCounter << " fragments." << endl;
-
-  Log() << Verbose(0) << "Parsing through each fragment and retrieving " << prefix << suffix << "." << endl;
+  DoLog(0) && (Log() << Verbose(0) << "Determined " << MatrixCounter << " fragments." << endl);
+
+  DoLog(0) && (Log() << Verbose(0) << "Parsing through each fragment and retrieving " << prefix << suffix << "." << endl);
   Header = ReAlloc<char*>(Header, MatrixCounter + 1, "MatrixContainer::ParseFragmentMatrix: **Header"); // one more each for the total molecule
   Matrix = ReAlloc<double**>(Matrix, MatrixCounter + 1, "MatrixContainer::ParseFragmentMatrix: ***Matrix"); // one more each for the total molecule
@@ -469,5 +469,5 @@
   char *FragmentNumber = NULL;
 
-  Log() << Verbose(0) << "Writing fragment files." << endl;
+  DoLog(0) && (Log() << Verbose(0) << "Writing fragment files." << endl);
   for(int i=0;i<MatrixCounter;i++) {
     stringstream line;
@@ -503,5 +503,5 @@
   stringstream line;
 
-  Log() << Verbose(0) << "Writing matrix values of " << suffix << "." << endl;
+  DoLog(0) && (Log() << Verbose(0) << "Writing matrix values of " << suffix << "." << endl);
   line << name << prefix << suffix;
   output.open(line.str().c_str(), ios::out);
@@ -529,5 +529,5 @@
 bool EnergyMatrix::ParseIndices()
 {
-  Log() << Verbose(0) << "Parsing energy indices." << endl;
+  DoLog(0) && (Log() << Verbose(0) << "Parsing energy indices." << endl);
   Indices = Malloc<int*>(MatrixCounter + 1, "EnergyMatrix::ParseIndices: **Indices");
   for(int i=MatrixCounter+1;i--;) {
@@ -588,5 +588,5 @@
     }
     // allocate last plus one matrix
-    Log() << Verbose(0) << "Allocating last plus one matrix with " << (RowCounter[MatrixCounter]+1) << " rows and " << ColumnCounter[MatrixCounter] << " columns." << endl;
+    DoLog(0) && (Log() << Verbose(0) << "Allocating last plus one matrix with " << (RowCounter[MatrixCounter]+1) << " rows and " << ColumnCounter[MatrixCounter] << " columns." << endl);
     Matrix[MatrixCounter] = Malloc<double*>(RowCounter[MatrixCounter] + 1, "MatrixContainer::ParseFragmentMatrix: **Matrix[]");
     for(int j=0;j<=RowCounter[MatrixCounter];j++)
@@ -615,5 +615,5 @@
   stringstream line;
 
-  Log() << Verbose(0) << "Parsing force indices for " << MatrixCounter << " matrices." << endl;
+  DoLog(0) && (Log() << Verbose(0) << "Parsing force indices for " << MatrixCounter << " matrices." << endl);
   Indices = Malloc<int*>(MatrixCounter + 1, "ForceMatrix::ParseIndices: **Indices");
   line << name << FRAGMENTPREFIX << FORCESFILE;
@@ -621,5 +621,5 @@
   //Log() << Verbose(0) << "Opening " << line.str() << " ... "  << input << endl;
   if (input == NULL) {
-    Log() << Verbose(0) << endl << "Unable to open " << line.str() << ", is the directory correct?" << endl;
+    DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << line.str() << ", is the directory correct?" << endl);
     return false;
   }
@@ -700,5 +700,5 @@
     input.open(file.str().c_str(), ios::in);
     if (input == NULL) {
-      Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl;
+      DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl);
       return false;
     }
@@ -724,5 +724,5 @@
   
     // allocate last plus one matrix
-    Log() << Verbose(0) << "Allocating last plus one matrix with " << (RowCounter[MatrixCounter]+1) << " rows and " << ColumnCounter[MatrixCounter] << " columns." << endl;
+    DoLog(0) && (Log() << Verbose(0) << "Allocating last plus one matrix with " << (RowCounter[MatrixCounter]+1) << " rows and " << ColumnCounter[MatrixCounter] << " columns." << endl);
     Matrix[MatrixCounter] = Malloc<double*>(RowCounter[MatrixCounter] + 1, "MatrixContainer::ParseFragmentMatrix: **Matrix[]");
     for(int j=0;j<=RowCounter[MatrixCounter];j++)
@@ -753,5 +753,5 @@
   stringstream line;
   
-  Log() << Verbose(0) << "Parsing hessian indices for " << MatrixCounter << " matrices." << endl;
+  DoLog(0) && (Log() << Verbose(0) << "Parsing hessian indices for " << MatrixCounter << " matrices." << endl);
   Indices = Malloc<int*>(MatrixCounter + 1, "HessianMatrix::ParseIndices: **Indices");
   line << name << FRAGMENTPREFIX << FORCESFILE;
@@ -759,5 +759,5 @@
   //Log() << Verbose(0) << "Opening " << line.str() << " ... "  << input << endl;
   if (input == NULL) {
-    Log() << Verbose(0) << endl << "Unable to open " << line.str() << ", is the directory correct?" << endl;
+    DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << line.str() << ", is the directory correct?" << endl);
     return false;
   }
@@ -930,5 +930,5 @@
     input.open(file.str().c_str(), ios::in);
     if (input == NULL) {
-      Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl;
+      DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl);
       return false;
     }
@@ -952,5 +952,5 @@
   
     // allocate last plus one matrix
-    Log() << Verbose(0) << "Allocating last plus one matrix with " << (RowCounter[MatrixCounter]+1) << " rows and " << ColumnCounter[MatrixCounter] << " columns." << endl;
+    DoLog(0) && (Log() << Verbose(0) << "Allocating last plus one matrix with " << (RowCounter[MatrixCounter]+1) << " rows and " << ColumnCounter[MatrixCounter] << " columns." << endl);
     Matrix[MatrixCounter] = Malloc<double*>(RowCounter[MatrixCounter] + 1, "MatrixContainer::ParseFragmentMatrix: **Matrix[]");
     for(int j=0;j<=RowCounter[MatrixCounter];j++)
@@ -1007,5 +1007,5 @@
 
   FragmentCounter = FCounter;
-  Log() << Verbose(0) << "Parsing key sets." << endl;
+  DoLog(0) && (Log() << Verbose(0) << "Parsing key sets." << endl);
   KeySets = Malloc<int*>(FragmentCounter, "KeySetsContainer::ParseKeySets: **KeySets");
   for(int i=FragmentCounter;i--;)
@@ -1014,5 +1014,5 @@
   input.open(file.str().c_str(), ios::in);
   if (input == NULL) {
-    Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl;
+    DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl);
     return false;
   }
@@ -1048,5 +1048,5 @@
   int Counter;
 
-  Log() << Verbose(0) << "Creating Fragment terms." << endl;
+  DoLog(0) && (Log() << Verbose(0) << "Creating Fragment terms." << endl);
   // scan through all to determine maximum order
   Order=0;
@@ -1059,5 +1059,5 @@
       Order = Counter;
   }
-  Log() << Verbose(0) << "Found Order is " << Order << "." << endl;
+  DoLog(0) && (Log() << Verbose(0) << "Found Order is " << Order << "." << endl);
 
   // scan through all to determine fragments per order
@@ -1073,5 +1073,5 @@
   }
   for(int i=0;i<Order;i++)
-    Log() << Verbose(0) << "Found No. of Fragments of Order " << i+1 << " is " << FragmentsPerOrder[i] << "." << endl;
+    DoLog(0) && (Log() << Verbose(0) << "Found No. of Fragments of Order " << i+1 << " is " << FragmentsPerOrder[i] << "." << endl);
 
   // scan through all to gather indices to each order set
@@ -1089,12 +1089,12 @@
     FragmentsPerOrder[Counter-1]++;
   }
-  Log() << Verbose(0) << "Printing OrderSet." << endl;
+  DoLog(0) && (Log() << Verbose(0) << "Printing OrderSet." << endl);
   for(int i=0;i<Order;i++) {
     for (int j=0;j<FragmentsPerOrder[i];j++) {
-      Log() << Verbose(0) << " " << OrderSet[i][j];
-    }
-    Log() << Verbose(0) << endl;
-  }
-  Log() << Verbose(0) << endl;
+      DoLog(0) && (Log() << Verbose(0) << " " << OrderSet[i][j]);
+    }
+    DoLog(0) && (Log() << Verbose(0) << endl);
+  }
+  DoLog(0) && (Log() << Verbose(0) << endl);
 
 
