Index: trunk/MagicSoft/Cosy/main/MCosy.cc
===================================================================
--- trunk/MagicSoft/Cosy/main/MCosy.cc	(revision 8847)
+++ trunk/MagicSoft/Cosy/main/MCosy.cc	(revision 8852)
@@ -214,5 +214,5 @@
 
     MTime t(-1);
-    gLog << t << " - MCosy::WaitForEndMovement aborted...";
+    gLog << inf << t << " - MCosy::WaitForEndMovement aborted...";
     if (Break())
         gLog << " Break signal...";
@@ -279,5 +279,5 @@
     if (d.Zd()<fMin.Zd())
     {
-        gLog << "ERROR: Requested Zenith Angle below negative endswitch." << endl;
+        gLog << err << "ERROR: Requested Zenith Angle below negative endswitch." << endl;
         return kFALSE;
     }
@@ -285,5 +285,5 @@
     if (d.Zd()>fMax.Zd())
     {
-        gLog << "ERROR: Requested Zenith Angle behind positive endswitch." << endl;
+        gLog << err << "ERROR: Requested Zenith Angle behind positive endswitch." << endl;
         return kFALSE;
     }
@@ -291,5 +291,5 @@
     if (d.Az()<fMin.Az())
     {
-        gLog << "ERROR: Requested Azimuth Angle below negative endswitch." << endl;
+        gLog << err << "ERROR: Requested Azimuth Angle below negative endswitch." << endl;
         return kFALSE;
     }
@@ -297,5 +297,5 @@
     if (d.Az()>fMax.Az())
     {
-        gLog << "ERROR: Requested Azimuth Angle behind positive endswitch." << endl;
+        gLog << err << "ERROR: Requested Azimuth Angle behind positive endswitch." << endl;
         return kFALSE;
     }
@@ -497,5 +497,5 @@
     // set deceleration to 50%
     //
-    cout << "Stopping movement (dec=30%)..." << endl;
+    gLog << inf2 << "Stopping movement (dec=30%)..." << endl;
     if (fMac1 && fMac2)
     {
@@ -575,5 +575,5 @@
     {
     case WM_WAIT:
-        cout << "Wait for execution of Proc(WM_*, ): done." << endl;
+        gLog << inf2 << "Wait for execution of Proc(WM_*, ): done." << endl;
         return 0;
 
@@ -913,5 +913,5 @@
         if (!CheckNetwork())
         {
-            gLog << "ERROR: Cannot shutdown CANbus network." << endl;
+            gLog << err << "ERROR: Cannot shutdown CANbus network." << endl;
             return 0xebb0;
         }
@@ -932,9 +932,9 @@
 void MCosy::ReadConfig()
 {
-    cout << "Reading configuration file..." << flush;
+    gLog << inf2 << "Reading configuration file..." << flush;
     TEnv env(".cosyrc");
-    cout << "done." << endl;
-
-    cout << "Reading telescope range..." << flush;
+    gLog << "done." << endl;
+
+    gLog << inf2 << "Reading telescope range..." << flush;
     const Double_t amin = env.GetValue("Az_Min[deg]", -95.0);
     const Double_t zmin = env.GetValue("Zd_Min[deg]", -75.0);
@@ -944,16 +944,16 @@
     const Double_t zmax = env.GetValue("Zd_Max[deg]", 98.25);
     fMax.Set(zmax, amax);
-    cout << "done." << endl;
-
-    cout << " * Min:  " << zmin << "deg  " << amin << "deg" << endl;
-    cout << " * Max:  " << zmax << "deg  " << amax << "deg" << endl;
+    gLog << "done." << endl;
+
+    gLog << all << " * Min:  " << zmin << "deg  " << amin << "deg" << endl;
+    gLog << all << " * Max:  " << zmax << "deg  " << amax << "deg" << endl;
 
     fMin = fBending.AddOffsets(fMin/TMath::RadToDeg());
     fMax = fBending.AddOffsets(fMax/TMath::RadToDeg());
 
-    cout << " * Min': " << fMin.Zd()*TMath::RadToDeg() << "deg  " << fMin.Az()*TMath::RadToDeg() << "deg" << endl;
-    cout << " * Max': " << fMax.Zd()*TMath::RadToDeg() << "deg  " << fMax.Az()*TMath::RadToDeg() << "deg" << endl;
-
-    cout << "Reading gear ratios..." << flush;
+    gLog << all << " * Min': " << fMin.Zd()*TMath::RadToDeg() << "deg  " << fMin.Az()*TMath::RadToDeg() << "deg" << endl;
+    gLog << all << " * Max': " << fMax.Zd()*TMath::RadToDeg() << "deg  " << fMax.Az()*TMath::RadToDeg() << "deg" << endl;
+
+    gLog << inf2 << "Reading gear ratios..." << flush;
 //    kGear.X(env.GetValue("Zd_GearRatio[U_mot/U_tel]", 1000.0));
 //    kGear.Y(env.GetValue("Az_GearRatio[U_mot/U_tel]", 1000.0));
@@ -1019,10 +1019,11 @@
 //    kGearTot = kResRE*kGear;
 
-    cout << "done." << endl;
-
-    cout << " * Setting Gear Ratios:" << endl;
-    cout << "   --------------------" << endl;
-    cout << " *  X: " << kGear.X() << "*" << kResRE.X()/4 << "/" << kResSE.X() << "=4*" << kGearTot.X() << "/" << kResSE.X() << endl;
-    cout << " *  Y: " << kGear.Y() << "*" << kResRE.Y()/4 << "/" << kResSE.Y() << "=4*" << kGearTot.Y() << "/" << kResSE.Y() << endl;
+    gLog << "done." << endl;
+
+    gLog << all;
+    gLog << " * Setting Gear Ratios:" << endl;
+    gLog << "   --------------------" << endl;
+    gLog << " *  X: " << kGear.X() << "*" << kResRE.X()/4 << "/" << kResSE.X() << "=4*" << kGearTot.X() << "/" << kResSE.X() << endl;
+    gLog << " *  Y: " << kGear.Y() << "*" << kResRE.Y()/4 << "/" << kResSE.Y() << "=4*" << kGearTot.Y() << "/" << kResSE.Y() << endl;
 }
 /*
@@ -1050,5 +1051,5 @@
     if (fHist)
     {
-        gLog << "You are much too fast... try again." << endl;
+        gLog << err << "You are much too fast... try again." << endl;
         return;
     }
@@ -1063,5 +1064,5 @@
     int cnt = 0;
 
-    gLog << "Starting Shaftencoder Test..." << endl;
+    gLog << inf2 << "Starting Shaftencoder Test..." << endl;
 
     while (fBackground==kBgdSeTest)
@@ -1102,5 +1103,5 @@
     }
 
-    gLog << "Shaftencoder Test Stopped... displaying Histogram." << endl;
+    gLog << inf2 << "Shaftencoder Test Stopped... displaying Histogram." << endl;
 
     fBackground=kBgdSeTestDispl;
@@ -1114,5 +1115,5 @@
     if (fHist)
     {
-        gLog << "You are much too fast... try again." << endl;
+        gLog << err << "You are much too fast... try again." << endl;
         return;
     }
@@ -1127,5 +1128,5 @@
     fHist->SetZTitle("Re/Se");
 
-    gLog << "Starting Gear determination..." << endl;
+    gLog << inf2 << "Starting Gear determination..." << endl;
 
     ZdAz se0 = GetSePos();
@@ -1173,5 +1174,5 @@
         }
     }
-    gLog << "Gear Test Stopped... displaying Histogram." << endl;
+    gLog << inf2 << "Gear Test Stopped... displaying Histogram." << endl;
 
     fBackground=kBgdGearDispl;
@@ -1249,9 +1250,9 @@
     const Int_t rc = fMutexGui.TryLock();
     if (rc==13)
-        cout << "MCosy::HandleTimer - mutex is already locked by this thread" << endl;
+        gLog << warn << "MCosy::HandleTimer - mutex is already locked by this thread" << endl;
 
     if (rc)
     {
-        gLog << "* GUI update skipped due to locked mutex." << endl;
+        gLog << warn << "* GUI update skipped due to locked mutex." << endl;
         return kTRUE;
     }
@@ -1303,5 +1304,5 @@
 
     if (fMutexGui.UnLock()==13)
-        cout << "MCosy::HandleTimer - tried to unlock mutex locked by other thread." << endl;
+        gLog << warn << "MCosy::HandleTimer - tried to unlock mutex locked by other thread." << endl;
 
     return kTRUE;
@@ -1310,5 +1311,5 @@
 void MCosy::DisplayHistTestSe(Bool_t del)
 {
-    gLog << "Displaying histogram..." << endl;
+    gLog << inf2 << "Displaying histogram..." << endl;
 
     TH2F &hist = *(TH2F*)fHist;
@@ -1348,5 +1349,5 @@
 void MCosy::DisplayHistGear(Bool_t del)
 {
-    gLog << "Displaying histogram..." << endl;
+    gLog << inf2 << "Displaying histogram..." << endl;
 
     TH3F &hist = *(TH3F*)fHist;
@@ -1442,8 +1443,8 @@
     ReadConfig();
 
-    gLog << "- Starting TX Thread." << endl;
+    gLog << inf << "- Starting TX Thread." << endl;
     fTTalk = new MTTalk(this);
 
-    gLog << "- Starting GUI update." << endl;
+    gLog << inf << "- Starting GUI update." << endl;
     fUpdateGui->TurnOn();
 }
@@ -1486,5 +1487,5 @@
     // Create Nodes
     //
-    gLog << "- Setting up network." << endl;
+    gLog << inf << "- Setting up network." << endl;
 
     fMac1=new Macs(id1, "Mac/Az");
@@ -1505,5 +1506,5 @@
     fZd2->SetMotor(fMac2);
  
-    gLog << "- Connecting devices to network." << endl;
+    gLog << inf << "- Connecting devices to network." << endl;
 
     //
@@ -1521,8 +1522,8 @@
     // Create Gui Event timer and Gui
     //
-    gLog << "- Initializing GUI Timer." << endl;
+    gLog << inf << "- Initializing GUI Timer." << endl;
     fUpdateGui = new TTimer(this, 100); // 100ms
 
-    gLog << "- Starting GUI." << endl;
+    gLog << all << "- Starting GUI." << endl;
     fWin=new MGCosy(fObservatory, this, gClient->GetRoot(), 1, 1);
 }
@@ -1624,5 +1625,5 @@
 
     TString name = GetFileName("rep", "cosy", "rep");
-    cout << "Open Repfile: " << name << endl;
+    gLog << inf << "Open Repfile: " << name << endl;
     fOutRep = new MLog(name, kTRUE);
     *fOutRep << "[Drive Report File]" << endl;
@@ -1662,5 +1663,5 @@
 void MCosy::TerminateApp()
 {
-    cout << "MCosy::TerminateApp()" << endl;
+    gLog << inf2 << "MCosy::TerminateApp()" << endl;
 /*
     Int_t rc;
@@ -1682,5 +1683,5 @@
 MCosy::~MCosy()
 {
-    cout << "Deleting GUI timer." << endl;
+    gLog << inf2 << "Deleting GUI timer." << endl;
     // FIXME: Wait until last Update was finished!!!
     delete fUpdateGui;
@@ -1689,5 +1690,5 @@
 
     // Now the files can safely be closed
-    cout << "Closing output files." << endl;
+    gLog << inf2 << "Closing output files." << endl;
     if (fOutTp)
     {
@@ -1697,8 +1698,8 @@
     delete fOutRep;
 
-    cout << "Deleting CC communication." << endl;
+    gLog << inf2 << "Deleting CC communication." << endl;
     delete fCom;
 
-    cout << "Deleting Nodes." << endl;
+    gLog << inf2 << "Deleting Nodes." << endl;
     fZd1->SetReport(0);
     fZd2->SetReport(0);
@@ -1713,5 +1714,5 @@
         delete fMac3;
 
-    cout << "Deleting MGCosy." << endl;
+    gLog << inf2 << "Deleting MGCosy." << endl;
 
     gLog.DisableOutputDevice(MLog::eGui);
@@ -1719,4 +1720,4 @@
     delete fWin;
 
-    cout << "MGCosy destructed." << endl;
-}
+    gLog << inf2 << "MGCosy destructed." << endl;
+}
