Index: trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc	(revision 5389)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc	(revision 5401)
@@ -825,7 +825,12 @@
   // Re-direct the output to an ascii-file from now on:
   //
+  MLog *oldlog = fLog;
   MLog asciilog;
-  asciilog.SetOutputFile(GetOutputFile(),kTRUE);
-  SetLogStream(&asciilog);
+  if (!fOutputFile.IsNull())
+  {
+      asciilog.SetOutputFile(GetOutputFile(),kTRUE);
+      SetLogStream(&asciilog);
+  }
+
   //
   // Finalize calibration statistics
@@ -874,5 +879,6 @@
                     "Pixels with unsuccesful Gauss fit to the Lo Gain: ");
 
-  SetLogStream(&gLog);
+  if (!fOutputFile.IsNull())
+      SetLogStream(oldlog);
 
   return kTRUE;
