Index: /trunk/MagicSoft/Cosy/main/MTracking.cc
===================================================================
--- /trunk/MagicSoft/Cosy/main/MTracking.cc	(revision 8824)
+++ /trunk/MagicSoft/Cosy/main/MTracking.cc	(revision 8825)
@@ -1,3 +1,5 @@
 #include "MTracking.h"
+
+#include "MLogManip.h"
 
 #include "macs.h"
@@ -52,5 +54,5 @@
     //
     if (fCosy->HasError())
-        gLog << "Error while requesting re pos from Macs (SDO #6004)" << endl;
+        gLog << err << "ERROR - while requesting re pos from Macs (SDO #6004)" << endl;
 
     return false;
@@ -93,5 +95,5 @@
     //
     if (fCosy->HasError())
-        gLog << "Error while setting tracking velocity (SDO #3006)" << endl;
+        gLog << err << "ERROR - while setting tracking velocity (SDO #3006)" << endl;
 
     return kFALSE;
@@ -223,5 +225,5 @@
     {
         vt->Az(maxtrack*vraz*4*sgn(vcalc.Az()));
-        gLog << "Warning: Azimuth speed limit (" << maxtrack*100 << "%) exceeded (" << fabs(vt->Az()) << " > " << maxtrack*vraz << ")... limited." << endl;
+        gLog << warn << "Warning: Azimuth speed limit (" << maxtrack*100 << "%) exceeded (" << fabs(vt->Az()) << " > " << maxtrack*vraz << ")... limited." << endl;
         gLog << "Vcalc: " << vcalc.Zd() << " " << vcalc.Az() << "re/min" <<endl;
         rc=kTRUE;
@@ -230,5 +232,5 @@
     {
         vt->Zd(maxtrack*vrzd*4*sgn(vcalc.Zd()));
-        gLog << "Warning: Altitude speed limit (" << maxtrack*100 << "%) exceeded (" << fabs(vt->Zd()) <<" > " << maxtrack*vrzd << ")... limited." << endl;
+        gLog << warn << "Warning: Altitude speed limit (" << maxtrack*100 << "%) exceeded (" << fabs(vt->Zd()) <<" > " << maxtrack*vrzd << ")... limited." << endl;
         gLog << "Vcalc: " << vcalc.Zd() << " " << vcalc.Az() << "re/min" <<endl;
         rc=kTRUE;
@@ -247,5 +249,6 @@
 {
      // Conversion factor from se to re
-     const XY re = fCosy->kGearTot/fCosy->kResSE; //[re/se]
+     //const XY re = fCosy->kGearTot/fCosy->kResSE; //[re/se]
+     const XY re = Div(fCosy->kGearTot, fCosy->kResSE); //[re/se]
 
      // Check wether moving direction has changed
@@ -329,5 +332,5 @@
     ZdAz dest = sla.CalcZdAz(dst);
 
-    gLog << sla.GetTime() << ": Track Position " << dst.Ra()*kRad2Deg/15 << "h, " << dst.Dec()*kRad2Deg <<"deg" << endl;
+    gLog << all << sla.GetTime() << ": Track Position " << dst.Ra()*kRad2Deg/15 << "h, " << dst.Dec()*kRad2Deg <<"deg" << endl;
 
     // If the star is culminating behind the zenith (South) we want to
@@ -338,5 +341,5 @@
     {
         // align az from -180/180 to 0/360
-        gLog << "Star culminating behind zenith: Adding 360deg to Azimuth " << dest.Az()*kRad2Deg << endl;
+        gLog << inf2 << "Star culminating behind zenith: Adding 360deg to Azimuth " << dest.Az()*kRad2Deg << endl;
         dest.Az(dest.Az() + TMath::TwoPi());
     }
@@ -347,5 +350,5 @@
     if (!SetPosition(dest, kTRUE))
     {
-        gLog << "Error: Cannot start tracking, positioning failed." << endl;
+        gLog << err << "ERROR - Cannot start tracking, positioning failed." << endl;
         return;
     }
@@ -385,6 +388,6 @@
 
     // Some output
-    XY xy(Rad2Deg(dst.Ra())*24/360, Rad2Deg(dst.Dec()));
-    gLog << sla.GetTime() << " - Start Tracking: Ra=" << xy.X() << "h Dec=";
+    XY xy(TMath::RadToDeg()*dst.Ra()*24/360, TMath::RadToDeg()*dst.Dec());
+    gLog << all << sla.GetTime() << " - Start Tracking: Ra=" << xy.X() << "h Dec=";
     gLog << xy.Y() << "\xb0 @ Zd=" << pos.Zd()*kRad2Deg <<"deg Az=" << pos.Az()*kRad2Deg <<"deg" << endl;
 
@@ -469,5 +472,5 @@
         if (LimitSpeed(&v, sla))
         {
-            gLog << "vt: " << v.Zd() << " " << v.Az() << "re/min" << endl;
+            gLog << dbg << "vt: " << v.Zd() << " " << v.Az() << "re/min" << endl;
             gLog << "Dest: " << dest.Zd() << " " << dest.Az() << endl;
         }
@@ -487,5 +490,5 @@
         if (vt.Zd()>.9*fCosy->fMac1->GetVelRes() || vt.Az()>.9*fCosy->fMac2->GetVelRes())
         {
-            gLog << "Error: Tracking speed faster than 90% of possible maximum velocity." << endl;
+            gLog << err << "ERROR - Tracking speed faster than 90% of possible maximum velocity." << endl;
             break;
         }
@@ -532,5 +535,5 @@
     fCosy->StopMovement();
 
-    gLog << sla.GetTime() << " - Tracking stopped @ Zd=";
+    gLog << all << sla.GetTime() << " - Tracking stopped @ Zd=";
     gLog << fCosy->fZdAzSoll.Zd()*TMath::RadToDeg() <<"deg Az=";
     gLog << fCosy->fZdAzSoll.Az()*TMath::RadToDeg() <<"deg" << endl;
@@ -548,5 +551,5 @@
         return 3;
 
-    gLog << "- Tracking Thread started (" << MTime(-1) << ")" << endl;
+    gLog << inf2 << "- Tracking Thread started (" << MTime(-1) << ")" << endl;
 
     //const XY re2se = fCosy->kGearTot/fCosy->kResSE; //[re/se]
@@ -648,5 +651,5 @@
     }
 
-    gLog << "- Tracking Thread done. (" << MTime(-1) << ")" << endl;
+    gLog << inf2 << "- Tracking Thread done. (" << MTime(-1) << ")" << endl;
     return 0;
 }
