1
0
Fork 0

Change cout and cerr in SG_LOG() where appropriate, otherwise comment it out

This commit is contained in:
ehofman 2003-03-20 10:43:02 +00:00
parent f2e2101264
commit df2ce45ab7
14 changed files with 89 additions and 73 deletions

View 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);

View 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;

View 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;

View 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;

View 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;
}

View 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");

View 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

View 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()" );
}

View 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(),

View 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);

View 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);

View file

@ -36,7 +36,10 @@
#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;
}

View 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;
}

View 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 ()