]> git.mxchange.org Git - flightgear.git/commitdiff
Change cout and cerr in SG_LOG() where appropriate, otherwise comment it out
authorehofman <ehofman>
Thu, 20 Mar 2003 10:43:02 +0000 (10:43 +0000)
committerehofman <ehofman>
Thu, 20 Mar 2003 10:43:02 +0000 (10:43 +0000)
14 files changed:
src/Airports/runways.cxx
src/Airports/simple.cxx
src/Cockpit/kr_87.cxx
src/Cockpit/navcom.cxx
src/FDM/IO360.cxx
src/GUI/gui_funcs.cxx
src/Main/fg_init.cxx
src/Main/fg_props.cxx
src/Main/main.cxx
src/Main/options.cxx
src/MultiPlayer/multiplayrxmgr.cxx
src/MultiPlayer/multiplaytxmgr.cxx
src/WeatherCM/linintp2.cpp
src/WeatherCM/sphrintp.cpp

index 07f1cf2249769200452881802fe29ad05a24f03c..ff45f4c7e7e00fe17c31a514d343e0fdb91de38b 100644 (file)
@@ -100,9 +100,9 @@ static string GetReverseRunwayNo(string rwyno) {
     string tmp = rwyno.substr(1, 1);
     if (( tmp == "L" || tmp == "R" || tmp == "C" ) || (rwyno.size() == 1)) {
        tmp = rwyno;
-       cout << "Standardising rwy number from " << tmp;
        rwyno = "0" + tmp;
-       cout << " to " << rwyno << '\n';
+        SG_LOG( SG_GENERAL, SG_INFO, "Standardising rwy number from " << tmp
+                                     << " to " << rwyno );
     }
     
     char buf[4];
@@ -196,9 +196,9 @@ bool FGRunways::search( const string& aptid, const string& rwyno, FGRunway* r )
     string tmp = runwayno.substr(1, 1);
     if (( tmp == "L" || tmp == "R" || tmp == "C" ) || (runwayno.size() == 1)) {
        tmp = runwayno;
-       cout << "Standardising rwy number from " << tmp;
        runwayno = "0" + tmp;
-       cout << " to " << runwayno << '\n';
+        SG_LOG(SG_GENERAL, SG_INFO, "Standardising rwy number from " << tmp
+                                     << " to " << runwayno );
     }
 
     c4_RowRef row = vRunway->GetAt(index);
index ba19df66a1724226c560035010c686fd6d7c520b..560b0d4668fc6092178cbdbcaee09cf82713ee16 100644 (file)
@@ -91,7 +91,7 @@ FGAirports::search( const string& id, FGAirport* a ) const
     c4_FloatProp pElev ("Elevation");
 
     int idx = vAirport->Find(pID[id.c_str()]);
-    cout << "idx = " << idx << endl;
+    SG_LOG( SG_TERRAIN, SG_INFO, "idx = " << idx );
 
     if ( idx == -1 ) {
        return false;
@@ -214,7 +214,7 @@ bool FGAirportsUtil::dump_mk4( const string& file ) {
     const_iterator end = airports.end();
     while ( current != end ) {
        // add each airport record
-       cout << "out -> " << current->id << endl;
+       SG_LOG( SG_TERRAIN, SG_BULK, "out -> " << current->id );
        pID (row) = current->id.c_str();
        pLon (row) = current->longitude;
        pLat (row) = current->latitude;
index 9c06f9a491968290c22d87464032793af1e714c6..a516443ca533deb41b17e8bcd0d70a5f089cc6c1 100644 (file)
@@ -284,7 +284,7 @@ void FGKR_87::update( double dt ) {
         if ( set_rst_btn == 1 && set_rst_btn == last_set_rst_btn ) {
             // button depressed and was last iteration too
             tmp_timer += dt;
-            cout << "tmp_timer = " << tmp_timer << endl;
+            // cout << "tmp_timer = " << tmp_timer << endl;
             if ( tmp_timer > 2.0 ) {
                 // button held depressed for 2 seconds
                 cout << "entering elapsed count down mode" << endl;
index 2f11e188d8f1c630836416ac2e3db458047ea193..6391c5d120b8b974ed7dc4574d10a47c29fda839 100644 (file)
@@ -547,7 +547,7 @@ void FGNavCom::search()
            if ( globals->get_soundmgr()->add( sound, nav_fx_name ) ) {
                 // cout << "Added nav-vor-ident sound" << endl;
             } else {
-                cout << "Failed to add v1-vor-ident sound" << endl;
+                SG_LOG(SG_COCKPIT, SG_WARN, "Failed to add v1-vor-ident sound");
             }
 
            if ( globals->get_soundmgr()->exists( dme_fx_name ) ) {
@@ -576,7 +576,7 @@ void FGNavCom::search()
        nav_trans_ident = "";
        last_nav_id = "";
        if ( ! globals->get_soundmgr()->remove( nav_fx_name ) ) {
-            cout << "Failed to remove nav-vor-ident sound" << endl;
+            SG_LOG(SG_COCKPIT, SG_WARN, "Failed to remove nav-vor-ident sound");
         }
        globals->get_soundmgr()->remove( dme_fx_name );
        // cout << "not picking up vor1. :-(" << endl;
index 9c256b29a352c557c77c7f15d13ac5ce37b02b3d..2c2d0db23a35a7584bc170f11b5824d838ef14ac 100644 (file)
@@ -26,8 +26,6 @@
 #include STL_FSTREAM
 #include STL_IOSTREAM
 
-SG_USING_STD(cout);
-
 #include "IO360.hxx"
 #include "LaRCsim/ls_constants.h"
 
@@ -131,10 +129,10 @@ void FGNewEngine::update() {
 //     cout << "n = " << RPM << " rpm\n";
 //      cout << "T_amb = " << T_amb << '\n';
 //     cout << "running = " << running << '\n';
-       cout << "fuel = " << fgGetFloat("/consumables/fuel/tank[0]/level-gal_us") << '\n';
+//     cout << "fuel = " << fgGetFloat("/consumables/fuel/tank[0]/level-gal_us") << '\n';
 //     cout << "Percentage_Power = " << Percentage_Power << '\n';
 //     cout << "current_oil_temp = " << current_oil_temp << '\n';
-       cout << "EGT = " << EGT << '\n';
+//     cout << "EGT = " << EGT << '\n';
     }
     count1++;
     if(count1 == 100)
@@ -340,7 +338,7 @@ float FGNewEngine::Lookup_Combustion_Efficiency(float thi_actual)
     }
 
     //if we get here something has gone badly wrong
-    cout << "ERROR: error in FGNewEngine::Lookup_Combustion_Efficiency\n";
+    SG_LOG(SG_AIRCRAFT, SG_ALERT, "error in FGNewEngine::Lookup_Combustion_Efficiency");
     return neta_comb_actual;
 }
 
@@ -394,7 +392,7 @@ float FGNewEngine::Power_Mixture_Correlation(float thi_actual)
     }
 
     //if we get here something has gone badly wrong
-    cout << "ERROR: error in FGNewEngine::Power_Mixture_Correlation\n";
+    SG_LOG(SG_AIRCRAFT, SG_ALERT, "error in FGNewEngine::Power_Mixture_Correlation");
     return mixPerPow_actual;
 }
 
index 0e54ff1cbf12aa57b76c95c462eccecf64a1cc51..e802c1d6263fcd78daaaf721d7e8e7d1da5a2e9f 100644 (file)
@@ -313,7 +313,7 @@ void SaveDialogOk(puObject*) {
     SaveDialogInput->getValue(&s);
 
     ofstream output(s);
-    cout << saveFile << endl;
+    // cout << saveFile << endl;
     if (output.good() && fgSaveFlight(output)) {
        output.close();
        mkDialog("Saved flight");
index 15fcf922e44d6c3c2405ccff4a792c57543b744c..9c77d4569606b874e99188c43e870b58880f49dd 100644 (file)
@@ -458,8 +458,8 @@ bool fgDetectLanguage() {
 
     SGPropertyNode *locale = fgInitLocale(language);
     if (!locale) {
-       cerr << "No internationalization settings specified in preferences.xml"
-            << endl;
+       SG_LOG(SG_GENERAL, SG_ALERT,
+              "No internationalization settings specified in preferences.xml" );
 
        return false;
     }
@@ -1212,11 +1212,11 @@ void fgInitFDM() {
 static void printMat(const sgVec4 *mat, char *name="")
 {
     int i;
-    cout << name << endl;
+    SG_LOG(SG_GENERAL, SG_BULK, name );
     for(i=0; i<4; i++) {
-        cout <<"  "<<mat[i][0]<<" "<<mat[i][1]<<" "<<mat[i][2]<<" "<<mat[i][3]<<endl;
+        SG_LOG(SG_GENERAL, SG_BULK, "  " << mat[i][0] << " " << mat[i][1]
+                                    << " " << mat[i][2] << " " << mat[i][3] );
     }
-    cout << endl;
 }
 
 // Initialize view parameters
index 23c51dd3cc3acd64d429da416cdf6255de0f102c..8b2f202ae5ab2d0fc9aae4b832afdf178495c64e 100644 (file)
@@ -463,7 +463,7 @@ getWindEast ()
 static void
 setWindEast (double speed)
 {
-  cout << "Set wind-east to " << speed << endl;
+  SG_LOG(SG_GENERAL, SG_INFO,, "Set wind-east to " << speed );
   current_aircraft.fdm_state->set_Velocities_Local_Airmass(getWindNorth(),
                                                           speed,
                                                           getWindDown());
@@ -578,7 +578,7 @@ setFDMDataLogging (bool state)
 void
 fgInitProps ()
 {
-  cout << "start of fgInitProps()" << endl;
+  SG_LOG(SG_GENERAL, SG_DEBUG, "start of fgInitProps()" );
                                // Simulation
   fgTie("/sim/logging/priority", getLoggingPriority, setLoggingPriority);
   fgTie("/sim/logging/classes", getLoggingClasses, setLoggingClasses);
@@ -617,7 +617,7 @@ fgInitProps ()
   fgTie("/sim/temp/full-screen", getFullScreen, setFullScreen);
   fgTie("/sim/temp/fdm-data-logging", getFDMDataLogging, setFDMDataLogging);
 
-  cout << "end of fgInitProps()" << endl;
+  SG_LOG(SG_GENERAL, SG_DEBUG, "end of fgInitProps()" );
 }
 
 
index 11c5c5a167703c0c60b732b16fcc4d3e4904ca40..bb12dcf6d2ed9d9703500618be13358e0f2640c4 100644 (file)
@@ -576,19 +576,21 @@ void fgRenderFrame() {
 
        // update the sky dome
        if ( fgGetBool("/sim/rendering/skyblend") ) {
-           /* cout << "thesky->repaint() sky_color = "
+           /*
+             SG_LOG( SG_GENERAL, SG_BULK, "thesky->repaint() sky_color = "
                 << cur_light_params.sky_color[0] << " "
                 << cur_light_params.sky_color[1] << " "
                 << cur_light_params.sky_color[2] << " "
-                << cur_light_params.sky_color[3] << endl;
-           cout << "    fog = "
+                << cur_light_params.sky_color[3] );
+           SG_LOG( SG_GENERAL, SG_BULK, "    fog = "
                 << cur_light_params.fog_color[0] << " "
                 << cur_light_params.fog_color[1] << " "
                 << cur_light_params.fog_color[2] << " "
-                << cur_light_params.fog_color[3] << endl;
-           cout << "    sun_angle = " << cur_light_params.sun_angle
-                << "    moon_angle = " << cur_light_params.moon_angle
-                 << endl; */
+                << cur_light_params.fog_color[3] ); 
+           SG_LOG( SG_GENERAL, SG_BULK,
+                    "    sun_angle = " << cur_light_params.sun_angle
+                << "    moon_angle = " << cur_light_params.moon_angle );
+            */
            thesky->repaint( cur_light_params.sky_color,
                             cur_light_params.adj_fog_color,
                             cur_light_params.sun_angle,
@@ -598,18 +600,24 @@ void fgRenderFrame() {
                             globals->get_ephem()->getNumStars(),
                             globals->get_ephem()->getStars() );
 
-           /* cout << "thesky->reposition( view_pos = " << view_pos[0] << " "
-                << view_pos[1] << " " << view_pos[2] << endl;
-           cout << "    zero_elev = " << zero_elev[0] << " "
+           /*
+            SG_LOG( SG_GENERAL, SG_BULK,
+                    "thesky->reposition( view_pos = " << view_pos[0] << " "
+                << view_pos[1] << " " << view_pos[2] );
+           SG_LOG( SG_GENERAL, SG_BULK,
+                    "    zero_elev = " << zero_elev[0] << " "
                 << zero_elev[1] << " " << zero_elev[2]
                 << " lon = " << cur_fdm_state->get_Longitude()
-                << " lat = " << cur_fdm_state->get_Latitude() << endl;
-           cout << "    sun_rot = " << cur_light_params.sun_rotation
-                << " gst = " << SGTime::cur_time_params->getGst() << endl;
-           cout << "    sun ra = " << globals->get_ephem()->getSunRightAscension()
-                << " sun dec = " << globals->get_ephem()->getSunDeclination()
-                << " moon ra = " << globals->get_ephem()->getMoonRightAscension()
-                << " moon dec = " << globals->get_ephem()->getMoonDeclination() << endl; */
+                << " lat = " << cur_fdm_state->get_Latitude() );
+           SG_LOG( SG_GENERAL, SG_BULK,
+                    "    sun_rot = " << cur_light_params.sun_rotation
+                << " gst = " << SGTime::cur_time_params->getGst() );
+           SG_LOG( SG_GENERAL, SG_BULK,
+                 "    sun ra = " << globals->get_ephem()->getSunRightAscension()
+              << " sun dec = " << globals->get_ephem()->getSunDeclination()
+              << " moon ra = " << globals->get_ephem()->getMoonRightAscension()
+              << " moon dec = " << globals->get_ephem()->getMoonDeclination() );
+            */
 
            thesky->reposition( current__view->get_view_pos(),
                                current__view->get_zero_elev(),
index 379aef91949b2b35f29d879f84564f17e169de83..e38d670fc83d2704666f74af414058b632c271ab 100644 (file)
@@ -338,7 +338,7 @@ parse_time(const string& time_in) {
        result += seconds / 3600.0;
     }
 
-    cout << " parse_time() = " << sign * result << endl;
+    SG_LOG( SG_GENERAL, SG_INFO, " parse_time() = " << sign * result );
 
     return(sign * result);
 }
@@ -526,11 +526,11 @@ parse_fov( const string& arg ) {
 
 static bool
 add_channel( const string& type, const string& channel_str ) {
-    cout << "Channel string = " << channel_str << endl;
+    SG_LOG(SG_GENERAL, SG_INFO, "Channel string = " << channel_str );
 
     globals->get_channel_options_list()->push_back( type + "," + channel_str );
     
-    cout << "here" << endl;
+    // cout << "here" << endl;
 
     return true;
 }
@@ -1808,7 +1808,7 @@ fgUsage (bool verbose)
 
     SGPropertyNode options_root;
 
-    cout << "" << endl;
+    cout << endl;
 
     try {
         fgLoadProps("options.xml", &options_root);
index 28d38e29376c6d2d80de42ac0152f29eec487b90..61ca69514c5da91c911deed778b52d6030d028e1 100644 (file)
@@ -56,6 +56,8 @@
 #include <arpa/inet.h>
 #include <plib/netSocket.h>
 #include <stdlib.h>
+
+#include <simgear/debug/logstream.hxx>
 #include <Main/fg_props.hxx>
 
 #include "multiplayrxmgr.hxx"
@@ -119,9 +121,13 @@ bool FGMultiplayRxMgr::init(void) {
         m_sRxAddress = fgGetString("/sim/multiplay/rxhost");
         m_iRxPort = fgGetInt("/sim/multiplay/rxport");
 
-        cout << "FGMultiplayRxMgr::init - rxaddress= " << m_sRxAddress << endl;
-        cout << "FGMultiplayRxMgr::init - rxport= " << m_iRxPort << endl;
-        cout << "FGMultiplayRxMgr::init - callsign= " << m_sCallsign << endl;
+        SG_LOG( SG_NETWORK, SG_INFO, "FGMultiplayRxMgr::init - rxaddress= "
+                                     << m_sRxAddress );
+        SG_LOG( SG_NETWORK, SG_INFO, "FGMultiplayRxMgr::init - rxport= "
+                                     << m_iRxPort);
+        SG_LOG( SG_NETWORK, SG_INFO, "FGMultiplayRxMgr::init - callsign= "
+                                     << m_sCallsign );
+
 
         // Create and open rx socket
         mDataRxSocket = new netSocket();
@@ -238,9 +244,9 @@ void FGMultiplayRxMgr::ProcessData(void) {
                             case CHAT_MSG_ID:
                                 if (MsgHdr->iMsgLen == sizeof(T_MsgHdr) + sizeof(T_ChatMsg)) {
                                     ChatMsg = (T_ChatMsg *)(sMsg + sizeof(T_MsgHdr));
-                                    cout << "Chat [" << MsgHdr->sCallsign << "]" << " " << ChatMsg->sText << endl;
+                                    SG_LOG( SG_NETWORK, SG_BULK, "Chat [" << MsgHdr->sCallsign << "]" << " " << ChatMsg->sText );
                                 } else {
-                                    cerr << "FGMultiplayRxMgr::MP_ProcessData - Chat message received with insufficient data" << endl;
+                                    SG_LOG( SG_NETWORK, SG_ALERT, "FGMultiplayRxMgr::MP_ProcessData - Chat message received with insufficient data" );
                                 }
                                 break;
 
@@ -268,8 +274,7 @@ void FGMultiplayRxMgr::ProcessData(void) {
                                         iPlayerCnt = 0;
                                         do {
                                             if (m_Player[iPlayerCnt] == NULL) {
-                                                cout << "FGMultiplayRxMgr::ProcessRxData - Add new player. IP: " << sIpAddress
-                                                    << ", Call: " <<  sCallsign << ", model: " << sModelName << endl;
+                                                SG_LOG( SG_NETWORK, SG_INFO, "FGMultiplayRxMgr::ProcessRxData - Add new player. IP: " << sIpAddress << ", Call: " <<  sCallsign << ", model: " << sModelName );
                                                 m_Player[iPlayerCnt] = new MPPlayer;
                                                 m_Player[iPlayerCnt]->Open(string(sIpAddress), iPort, string(sCallsign), string(sModelName), false);
                                                 m_Player[iPlayerCnt]->SetPosition(PosMsg->PlayerPos);
index 59a8991caef2270d72213c24e7bfa1bcaa73de17..0b4336b7864c937d2211ae6f903e3da691d30863 100644 (file)
 #include <arpa/inet.h>
 #include <plib/netSocket.h>
 #include <stdlib.h>
+
+#include <simgear/debug/logstream.hxx>
 #include <Main/fg_props.hxx>
+
 #include "multiplaytxmgr.hxx"
 #include "mpmessages.hxx"
 #include "mpplayer.hxx"
@@ -92,8 +95,10 @@ bool FGMultiplayTxMgr::init(void) {
         string sTxAddress = fgGetString("/sim/multiplay/txhost");
         iTxPort = fgGetInt("/sim/multiplay/txport");
 
-        cout << "FGMultiplayTxMgr::init - txaddress= " << sTxAddress << endl;
-        cout << "FGMultiplayTxMgr::init - txport= " << iTxPort << endl;
+        SG_LOG( SG_NETWORK, SG_INFO, "FGMultiplayTxMgr::init - txaddress= "
+                                     << sTxAddress );
+        SG_LOG( SG_NETWORK, SG_INFO, "FGMultiplayTxMgr::init - txport= "
+                                     << iTxPort );
         
         if (iTxPort > 0) {
 
@@ -126,7 +131,7 @@ bool FGMultiplayTxMgr::init(void) {
         // If Tx port == zero then don't initialise
         } else {
 
-            cout << "FGMultiplayTxMgr::init - Tx Port is zero. Multiplay out disabled." << endl;
+            SG_LOG( SG_NETWORK, SG_WARN, "FGMultiplayTxMgr::init - Tx Port is zero. Multiplay out disabled." );
             bSuccess = false;
 
         }
@@ -135,7 +140,7 @@ bool FGMultiplayTxMgr::init(void) {
         m_bInitialised = bSuccess;
 
     } else {
-        cerr << "FGMultiplayTxMgr::init - Attempt to init object that is already opened" << endl;
+        SG_LOG( SG_NETWORK, SG_ALERT, "FGMultiplayTxMgr::init - Attempt to init object that is already opened" );
         bSuccess = false;
     }
 
index d2ff5fe04b63f79f7073790f865e3a25642a0b46..3c6e640fbe249ae25d20eaa008155388b30e2d45 100644 (file)
@@ -53,7 +53,7 @@ mgcLinInterp2D::mgcLinInterp2D (int _numPoints, double* x, double* y,
         return;
     }
 
-    cout << "[ 20%] allocating memory                                              \r";
+    SG_LOG(SG_MATH, SG_DEBUG, "[ 20%] allocating memory");
 
     point = new double*[numPoints];
     tmppoint = new double*[numPoints+3];
@@ -71,7 +71,7 @@ mgcLinInterp2D::mgcLinInterp2D (int _numPoints, double* x, double* y,
        f[i] = _f[i];
     }
 
-    cout << "[ 30%] creating delaunay diagram                                      \r";
+    SG_LOG(SG_MATH, SG_DEBUG, "[ 30%] creating delaunay diagram");
 
     Delaunay2D();
 }
@@ -290,7 +290,7 @@ int mgcLinInterp2D::Delaunay2D ()
     nts = 1;  // number of triangles
     i4 = 1;
 
-    cout << "[ 40%] create triangulation                                           \r";
+    SG_LOG(SG_MATH, SG_DEBUG, "[ 40%] create triangulation");
 
     // compute triangulation
     for (i0 = 0; i0 < numPoints; i0++)
@@ -383,7 +383,7 @@ Corner3:;
     }
 
     // count the number of triangles
-    cout << "[ 50%] count the number of triangles                                  \r";
+    SG_LOG(SG_MATH, SG_DEBUG, "[ 50%] count the number of triangles");
 
     numTriangles = 0;
     i0 = -1;
@@ -405,7 +405,7 @@ Corner3:;
     }
 
     // create the triangles
-    cout << "[ 60%] create the triangles                                         \r";
+    SG_LOG(SG_MATH, SG_DEBUG "[ 60%] create the triangles");
 
     triangle = new Triangle[numTriangles];
 
@@ -439,7 +439,7 @@ Corner3:;
     }
 
     // build edge table
-    cout << "[ 70%] build the edge table                                       \r";
+    SG_LOG(SG_MATH, SG_DEBUG, "[ 70%] build the edge table");
 
     numEdges = 0;
     edge = new Edge[3*numTriangles];
@@ -448,7 +448,7 @@ Corner3:;
     for (i = 0; i < numTriangles; i++)
     {
        if ( (i%500) == 0)
-           cout << "[ 7" << 10*i/numTriangles << "%] build the edge table                     \r";
+           SG_LOG(SG_MATH, SG_BULK, "[ 7" << 10*i/numTriangles << "%] build the edge table");
 
         Triangle& t = triangle[i];
 
@@ -481,7 +481,7 @@ Corner3:;
     }
 
     // establish links between adjacent triangles
-    cout << "[ 80%] establishing links between adjacent triangles                   \r";
+    SG_LOG(SG_MATH, SG_DEBUG, "[ 80%] establishing links between adjacent triangles");
 
     for (i = 0; i < numEdges; i++)
     {
@@ -505,7 +505,7 @@ ExitDelaunay:;
     delete[] ccr[0];
     delete[] ccr;
 
-    cout << "[ 90%] finsishes delauney triangulation                            \r";
+    SG_LOG(SG_MATH, SG_DEBUG, "[ 90%] finsishes delauney triangulation");
 
     return result;
 }
index 2366c753b924c71c56e02555d8c7c5652c5cce5e..980e699e30eb935ea949f71b1d6cc8102e8fcc4e 100644 (file)
@@ -51,8 +51,8 @@ SphereInterpolate::SphereInterpolate (int n, const double* x,
     // For complete spherical coverage, include the two antipodal points
     // (0,0,1,f(0,0,1)) and (0,0,-1,f(0,0,-1)) in the data set.
     
-    cout << "Initialising spherical interpolator.\n";
-    cout << "[  0%] Allocating memory                                           \r";
+    SG_LOG(SG_MATH, SG_DEBUG, "Initialising spherical interpolator.");
+    SG_LOG(SG_MATH, SG_DEBUG, "[  0%] Allocating memory");
 
     theta = new double[3*n];
     phi = new double[3*n];
@@ -68,7 +68,7 @@ SphereInterpolate::SphereInterpolate (int n, const double* x,
     }
     
     // use periodicity to get wrap-around in the Delaunay triangulation
-    cout << "[ 10%] copying vertices for wrap-around\r";
+    SG_LOG(SG_MATH, SG_DEBUG, "[ 10%] copying vertices for wrap-aroundr");
     int j, k;
     for (i = 0, j = n, k = 2*n; i < n; i++, j++, k++)
     {
@@ -82,7 +82,7 @@ SphereInterpolate::SphereInterpolate (int n, const double* x,
     
     pInterp = new mgcLinInterp2D(3*n,theta,phi,func);
 
-    cout << "[100%] Finished initialising spherical interpolator.                   \n";
+    SG_LOG(SG_MATH, SG_DEBUG, "[100%] Finished initialising spherical interpolator.");
 }
 
 SphereInterpolate::SphereInterpolate (int n, const sgVec2* p, const unsigned int* f)
@@ -90,15 +90,15 @@ SphereInterpolate::SphereInterpolate (int n, const sgVec2* p, const unsigned int
     // Assumes (x[i],y[i],z[i]) is unit length for all 0 <= i < n.
     // For complete spherical coverage, include the two antipodal points
     // (0,0,1,f(0,0,1)) and (0,0,-1,f(0,0,-1)) in the data set.
-    cout << "Initialising spherical interpolator.\n";
-    cout << "[  0%] Allocating memory                                           \r";
+    SG_LOG(SG_MATH, SG_DEBUG, "Initialising spherical interpolator.");
+    SG_LOG(SG_MATH, SG_DEBUG, "[  0%] Allocating memory");
 
     theta = new double[3*n];
     phi = new double[3*n];
     func = new unsigned int[3*n];
 
     // convert data to spherical coordinates
-    cout << "[ 10%] copying vertices for wrap-around                              \r";
+    SG_LOG(SG_MATH, SG_DEBUG, "[ 10%] copying vertices for wrap-around");
 
     int i, j, k;
     for (i = 0, j = n, k = 2*n; i < n; i++, j++, k++)
@@ -118,7 +118,7 @@ SphereInterpolate::SphereInterpolate (int n, const sgVec2* p, const unsigned int
     
     pInterp = new mgcLinInterp2D(3*n,theta,phi,func);
 
-    cout << "[100%] Finished initialising spherical interpolator.                   \n";
+    SG_LOG(SG_MATH, SG_DEBUG, "[100%] Finished initialising spherical interpolator.");
 }
 //---------------------------------------------------------------------------
 SphereInterpolate::~SphereInterpolate ()