1
0
Fork 0

Enable release builds using the --without-logging option to the configure

script.  Also a couple log message cleanups, plus some C to C++ comment
conversion.
This commit is contained in:
curt 1998-11-07 19:07:06 +00:00
parent c74350c4fe
commit 2c2b68fc47
7 changed files with 80 additions and 30 deletions

View file

@ -90,7 +90,8 @@ gen_base( const Point3D& average, const container& perimeter, fgTILE *t)
max_dist = 0.0; max_dist = 0.0;
cout << "generating airport base for size = " << perimeter.size() << "\n"; FG_LOG( FG_TERRAIN, FG_INFO,
"generating airport base for size = " << perimeter.size() );
fragment.init(); fragment.init();
fragment.tile_ptr = t; fragment.tile_ptr = t;
@ -102,10 +103,12 @@ gen_base( const Point3D& average, const container& perimeter, fgTILE *t)
<< " in fgAptGenerat()" ); << " in fgAptGenerat()" );
} }
printf(" tile center = %.2f %.2f %.2f\n", FG_LOG( FG_TERRAIN, FG_INFO,
t->center.x(), t->center.y(), t->center.z() ); " tile center = "
printf(" airport center = %.2f %.2f %.2f\n", << t->center.x() << " " << t->center.y() << " " << t->center.z() );
average.x(), average.y(), average.z()); FG_LOG( FG_TERRAIN, FG_INFO,
" airport center = "
<< average.x() << " " << average.y() << " " << average.z() );
fragment.center = average; fragment.center = average;
normal[0] = average.x(); normal[0] = average.x();
@ -233,7 +236,7 @@ fgAptGenerate(const string& path, fgTILE *tile)
gen_base(average, perimeter, tile); gen_base(average, perimeter, tile);
} }
cout << "Reading airport record\n"; FG_LOG( FG_TERRAIN, FG_INFO, "Reading airport record" );
in >> apt_id; in >> apt_id;
apt_name = ""; apt_name = "";
i = 1; i = 1;
@ -243,7 +246,8 @@ fgAptGenerate(const string& path, fgTILE *tile)
while ( in.get(c) && c != '\n' ) { while ( in.get(c) && c != '\n' ) {
apt_name += c; apt_name += c;
} }
cout << "\tID = " + apt_id + " Name = " + apt_name + "\n"; FG_LOG( FG_TERRAIN, FG_INFO,
"\tID = " << apt_id << " Name = " << apt_name );
} else if ( token == "p" ) { } else if ( token == "p" ) {
// airport area bounding polygon coordinate. These // airport area bounding polygon coordinate. These
// specify a convex hull that should already have been cut // specify a convex hull that should already have been cut
@ -281,6 +285,11 @@ fgAptGenerate(const string& path, fgTILE *tile)
// $Log$ // $Log$
// Revision 1.10 1998/11/07 19:07:06 curt
// Enable release builds using the --without-logging option to the configure
// script. Also a couple log message cleanups, plus some C to C++ comment
// conversion.
//
// Revision 1.9 1998/11/06 21:17:32 curt // Revision 1.9 1998/11/06 21:17:32 curt
// Converted to new logstream debugging facility. This allows release // Converted to new logstream debugging facility. This allows release
// builds with no messages at all (and no performance impact) by using // builds with no messages at all (and no performance impact) by using

View file

@ -104,8 +104,9 @@ int fgStarsInit( void ) {
} }
timer.stop(); timer.stop();
cerr << "Loaded " << starcount << " stars in " FG_LOG( FG_ASTRO, FG_INFO,
<< timer.elapsedSeconds() << " seconds" << endl; "Loaded " << starcount << " stars in "
<< timer.elapsedSeconds() << " seconds" );
min_magnitude[0] = 4.2; min_magnitude[0] = 4.2;
min_magnitude[1] = 3.6; min_magnitude[1] = 3.6;
@ -254,6 +255,11 @@ void fgStarsRender( void ) {
// $Log$ // $Log$
// Revision 1.22 1998/11/07 19:07:07 curt
// Enable release builds using the --without-logging option to the configure
// script. Also a couple log message cleanups, plus some C to C++ comment
// conversion.
//
// Revision 1.21 1998/11/06 21:17:42 curt // Revision 1.21 1998/11/06 21:17:42 curt
// Converted to new logstream debugging facility. This allows release // Converted to new logstream debugging facility. This allows release
// builds with no messages at all (and no performance impact) by using // builds with no messages at all (and no performance impact) by using

View file

@ -693,8 +693,10 @@ static void fgIdleFunction ( void ) {
string slfile = current_options.get_fg_root() + "/Sounds/wasp.wav"; string slfile = current_options.get_fg_root() + "/Sounds/wasp.wav";
s1 = new slSample ( (char *)slfile.c_str() ); s1 = new slSample ( (char *)slfile.c_str() );
printf("Rate = %d Bps = %d Stereo = %d\n", FG_LOG( FG_GENERAL, FG_INFO,
s1 -> getRate(), s1 -> getBps(), s1 -> getStereo()); "Rate = " << s1 -> getRate()
<< " Bps = " << s1 -> getBps()
<< " Stereo = " << s1 -> getStereo() );
audio_sched -> loopSample ( s1 ); audio_sched -> loopSample ( s1 );
if ( audio_sched->working() ) { if ( audio_sched->working() ) {
@ -897,6 +899,11 @@ int main( int argc, char **argv ) {
// $Log$ // $Log$
// Revision 1.64 1998/11/07 19:07:09 curt
// Enable release builds using the --without-logging option to the configure
// script. Also a couple log message cleanups, plus some C to C++ comment
// conversion.
//
// Revision 1.63 1998/11/06 21:18:08 curt // Revision 1.63 1998/11/06 21:18:08 curt
// Converted to new logstream debugging facility. This allows release // Converted to new logstream debugging facility. This allows release
// builds with no messages at all (and no performance impact) by using // builds with no messages at all (and no performance impact) by using

View file

@ -105,7 +105,8 @@ int fgInitPosition( void ) {
FG_Longitude = current_options.get_lon() * DEG_TO_RAD; FG_Longitude = current_options.get_lon() * DEG_TO_RAD;
FG_Latitude = current_options.get_lat() * DEG_TO_RAD; FG_Latitude = current_options.get_lat() * DEG_TO_RAD;
} }
printf("starting altitude is = %.2f\n", current_options.get_altitude()); FG_LOG( FG_GENERAL, FG_INFO,
"starting altitude is = " << current_options.get_altitude() );
FG_Altitude = current_options.get_altitude() * METER_TO_FEET; FG_Altitude = current_options.get_altitude() * METER_TO_FEET;
FG_Runway_altitude = FG_Altitude - 3.758099; FG_Runway_altitude = FG_Altitude - 3.758099;
@ -376,6 +377,11 @@ int fgInitSubsystems( void )
// $Log$ // $Log$
// Revision 1.48 1998/11/07 19:07:10 curt
// Enable release builds using the --without-logging option to the configure
// script. Also a couple log message cleanups, plus some C to C++ comment
// conversion.
//
// Revision 1.47 1998/11/06 21:18:10 curt // Revision 1.47 1998/11/06 21:18:10 curt
// Converted to new logstream debugging facility. This allows release // Converted to new logstream debugging facility. This allows release
// builds with no messages at all (and no performance impact) by using // builds with no messages at all (and no performance impact) by using

View file

@ -293,7 +293,8 @@ fgMATERIAL_MGR::load_lib ( void )
in >> material_name >> token; in >> material_name >> token;
if ( token == '{' ) { if ( token == '{' ) {
printf( " Loading material %s\n", material_name.c_str() ); FG_LOG( FG_TERRAIN, FG_INFO,
" Loading material " << material_name );
fgMATERIAL m; fgMATERIAL m;
in >> m; in >> m;
@ -355,6 +356,11 @@ fgMATERIAL_MGR::render_fragments()
// $Log$ // $Log$
// Revision 1.11 1998/11/07 19:07:12 curt
// Enable release builds using the --without-logging option to the configure
// script. Also a couple log message cleanups, plus some C to C++ comment
// conversion.
//
// Revision 1.10 1998/11/06 21:18:17 curt // Revision 1.10 1998/11/06 21:18:17 curt
// Converted to new logstream debugging facility. This allows release // Converted to new logstream debugging facility. This allows release
// builds with no messages at all (and no performance impact) by using // builds with no messages at all (and no performance impact) by using

View file

@ -94,7 +94,7 @@ fgEVENT::~fgEVENT()
void void
fgEVENT::run() fgEVENT::run()
{ {
printf("Running %s\n", description.c_str() ); FG_LOG(FG_TIME, FG_INFO, "Running " << description );
// record starting time // record starting time
timestamp( &last_run ); timestamp( &last_run );
@ -131,11 +131,14 @@ fgEVENT::run()
int int
fgEVENT::PrintStats() const fgEVENT::PrintStats() const
{ {
printf(" %-30s int=%.2fs cum=%ld min=%ld max=%ld count=%ld ave=%.2f\n", FG_LOG( FG_TIME, FG_INFO,
description.c_str(), " " << description
interval / 1000.0, << " int=" << interval / 1000.0
cum_time, min_time, max_time, count, << " cum=" << cum_time
cum_time / (double)count); << " min=" << min_time
<< " max=" << max_time
<< " count=" << count
<< " ave=" << cum_time / (double)count );
return 0; return 0;
} }
@ -146,7 +149,7 @@ fgEVENT_MGR::fgEVENT_MGR( void ) {
// Initialize the scheduling subsystem // Initialize the scheduling subsystem
void fgEVENT_MGR::Init( void ) { void fgEVENT_MGR::Init( void ) {
printf("Initializing event manager\n"); FG_LOG(FG_TIME, FG_INFO, "Initializing event manager" );
run_queue.erase( run_queue.begin(), run_queue.end() ); run_queue.erase( run_queue.begin(), run_queue.end() );
event_table.erase( event_table.begin(), event_table.end() ); event_table.erase( event_table.begin(), event_table.end() );
@ -162,7 +165,7 @@ fgEVENT_MGR::Register( const string& desc,
{ {
fgEVENT e( desc, cb, status, interval ); fgEVENT e( desc, cb, status, interval );
printf("Registering event: %s\n", desc.c_str() ); FG_LOG( FG_TIME, FG_INFO, "Registering event: " << desc );
// Actually run the event // Actually run the event
e.run(); e.run();
@ -195,15 +198,15 @@ void fgEVENT_MGR::Resume( void ) {
void void
fgEVENT_MGR::PrintStats() fgEVENT_MGR::PrintStats()
{ {
printf("\n"); FG_LOG( FG_TIME, FG_INFO, "" );
printf("Event Stats\n"); FG_LOG( FG_TIME, FG_INFO, "Event Stats" );
printf("-----------\n"); FG_LOG( FG_TIME, FG_INFO, "-----------" );
for_each( event_table.begin(), for_each( event_table.begin(),
event_table.end(), event_table.end(),
mem_fun_ref( &fgEVENT::PrintStats )); mem_fun_ref( &fgEVENT::PrintStats ));
printf("\n"); FG_LOG( FG_TIME, FG_INFO, "");
} }
@ -258,6 +261,11 @@ fgEVENT_MGR::~fgEVENT_MGR( void ) {
// $Log$ // $Log$
// Revision 1.10 1998/11/07 19:07:13 curt
// Enable release builds using the --without-logging option to the configure
// script. Also a couple log message cleanups, plus some C to C++ comment
// conversion.
//
// Revision 1.9 1998/11/06 21:18:24 curt // Revision 1.9 1998/11/06 21:18:24 curt
// Converted to new logstream debugging facility. This allows release // Converted to new logstream debugging facility. This allows release
// builds with no messages at all (and no performance impact) by using // builds with no messages at all (and no performance impact) by using

View file

@ -45,6 +45,7 @@
//#include <Astro/orbits.hxx> //#include <Astro/orbits.hxx>
#include <Astro/solarsystem.hxx> #include <Astro/solarsystem.hxx>
#include <Debug/logstream.hxx>
#include <Include/fg_constants.h> #include <Include/fg_constants.h>
#include <Main/views.hxx> #include <Main/views.hxx>
#include <Math/fg_geodesy.hxx> #include <Math/fg_geodesy.hxx>
@ -193,7 +194,8 @@ static double julian_date(int y, int m, int d) {
/* lazy test to ensure gregorian calendar */ /* lazy test to ensure gregorian calendar */
if (y < 1583) { if (y < 1583) {
printf("WHOOPS! Julian dates only valid for 1582 oct 15 or later\n"); FG_LOG( FG_TIME, FG_ALERT,
"WHOOPS! Julian dates only valid for 1582 oct 15 or later" );
} }
if ((m == 1) || (m == 2)) { if ((m == 1) || (m == 2)) {
@ -338,7 +340,7 @@ void fgUpdateSunPos( void ) {
t = &cur_time_params; t = &cur_time_params;
v = &current_view; v = &current_view;
printf(" Updating Sun position\n"); FG_LOG( FG_TIME, FG_INFO, " Updating Sun position" );
// (not sure why there was two) // (not sure why there was two)
// fgSunPosition(t->cur_time, &l->sun_lon, &sun_gd_lat); // fgSunPosition(t->cur_time, &l->sun_lon, &sun_gd_lat);
@ -349,9 +351,10 @@ void fgUpdateSunPos( void ) {
p = Point3D( l->sun_lon, l->sun_gc_lat, sl_radius ); p = Point3D( l->sun_lon, l->sun_gc_lat, sl_radius );
l->fg_sunpos = fgPolarToCart3d(p); l->fg_sunpos = fgPolarToCart3d(p);
printf( " t->cur_time = %ld\n", t->cur_time); FG_LOG( FG_TIME, FG_INFO, " t->cur_time = " << t->cur_time );
printf( " Sun Geodetic lat = %.5f Geocentric lat = %.5f\n", FG_LOG( FG_TIME, FG_INFO,
sun_gd_lat, l->sun_gc_lat); " Sun Geodetic lat = " << sun_gd_lat
<< " Geocentric lat = " << l->sun_gc_lat );
// I think this will work better for generating the sun light vector // I think this will work better for generating the sun light vector
l->sun_vec[0] = l->fg_sunpos.x(); l->sun_vec[0] = l->fg_sunpos.x();
@ -423,6 +426,11 @@ void fgUpdateSunPos( void ) {
// $Log$ // $Log$
// Revision 1.16 1998/11/07 19:07:14 curt
// Enable release builds using the --without-logging option to the configure
// script. Also a couple log message cleanups, plus some C to C++ comment
// conversion.
//
// Revision 1.15 1998/10/18 01:17:24 curt // Revision 1.15 1998/10/18 01:17:24 curt
// Point3D tweaks. // Point3D tweaks.
// //