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.tile_ptr = t;
<< " in fgAptGenerat()" );
}
- printf(" tile center = %.2f %.2f %.2f\n",
- t->center.x(), t->center.y(), t->center.z() );
- printf(" airport center = %.2f %.2f %.2f\n",
- average.x(), average.y(), average.z());
+ FG_LOG( FG_TERRAIN, FG_INFO,
+ " tile center = "
+ << t->center.x() << " " << t->center.y() << " " << t->center.z() );
+ FG_LOG( FG_TERRAIN, FG_INFO,
+ " airport center = "
+ << average.x() << " " << average.y() << " " << average.z() );
fragment.center = average;
normal[0] = average.x();
gen_base(average, perimeter, tile);
}
- cout << "Reading airport record\n";
+ FG_LOG( FG_TERRAIN, FG_INFO, "Reading airport record" );
in >> apt_id;
apt_name = "";
i = 1;
while ( in.get(c) && c != '\n' ) {
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" ) {
// airport area bounding polygon coordinate. These
// specify a convex hull that should already have been cut
// $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
// Converted to new logstream debugging facility. This allows release
// builds with no messages at all (and no performance impact) by using
}
timer.stop();
- cerr << "Loaded " << starcount << " stars in "
- << timer.elapsedSeconds() << " seconds" << endl;
+ FG_LOG( FG_ASTRO, FG_INFO,
+ "Loaded " << starcount << " stars in "
+ << timer.elapsedSeconds() << " seconds" );
min_magnitude[0] = 4.2;
min_magnitude[1] = 3.6;
// $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
// Converted to new logstream debugging facility. This allows release
// builds with no messages at all (and no performance impact) by using
string slfile = current_options.get_fg_root() + "/Sounds/wasp.wav";
s1 = new slSample ( (char *)slfile.c_str() );
- printf("Rate = %d Bps = %d Stereo = %d\n",
- s1 -> getRate(), s1 -> getBps(), s1 -> getStereo());
+ FG_LOG( FG_GENERAL, FG_INFO,
+ "Rate = " << s1 -> getRate()
+ << " Bps = " << s1 -> getBps()
+ << " Stereo = " << s1 -> getStereo() );
audio_sched -> loopSample ( s1 );
if ( audio_sched->working() ) {
// $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
// Converted to new logstream debugging facility. This allows release
// builds with no messages at all (and no performance impact) by using
FG_Longitude = current_options.get_lon() * 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_Runway_altitude = FG_Altitude - 3.758099;
// $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
// Converted to new logstream debugging facility. This allows release
// builds with no messages at all (and no performance impact) by using
in >> material_name >> token;
if ( token == '{' ) {
- printf( " Loading material %s\n", material_name.c_str() );
+ FG_LOG( FG_TERRAIN, FG_INFO,
+ " Loading material " << material_name );
fgMATERIAL m;
in >> m;
// $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
// Converted to new logstream debugging facility. This allows release
// builds with no messages at all (and no performance impact) by using
void
fgEVENT::run()
{
- printf("Running %s\n", description.c_str() );
+ FG_LOG(FG_TIME, FG_INFO, "Running " << description );
// record starting time
timestamp( &last_run );
int
fgEVENT::PrintStats() const
{
- printf(" %-30s int=%.2fs cum=%ld min=%ld max=%ld count=%ld ave=%.2f\n",
- description.c_str(),
- interval / 1000.0,
- cum_time, min_time, max_time, count,
- cum_time / (double)count);
+ FG_LOG( FG_TIME, FG_INFO,
+ " " << description
+ << " int=" << interval / 1000.0
+ << " cum=" << cum_time
+ << " min=" << min_time
+ << " max=" << max_time
+ << " count=" << count
+ << " ave=" << cum_time / (double)count );
return 0;
}
// Initialize the scheduling subsystem
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() );
event_table.erase( event_table.begin(), event_table.end() );
{
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
e.run();
void
fgEVENT_MGR::PrintStats()
{
- printf("\n");
- printf("Event Stats\n");
- printf("-----------\n");
+ FG_LOG( FG_TIME, FG_INFO, "" );
+ FG_LOG( FG_TIME, FG_INFO, "Event Stats" );
+ FG_LOG( FG_TIME, FG_INFO, "-----------" );
for_each( event_table.begin(),
event_table.end(),
mem_fun_ref( &fgEVENT::PrintStats ));
- printf("\n");
+ FG_LOG( FG_TIME, FG_INFO, "");
}
// $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
// Converted to new logstream debugging facility. This allows release
// builds with no messages at all (and no performance impact) by using
//#include <Astro/orbits.hxx>
#include <Astro/solarsystem.hxx>
+#include <Debug/logstream.hxx>
#include <Include/fg_constants.h>
#include <Main/views.hxx>
#include <Math/fg_geodesy.hxx>
/* lazy test to ensure gregorian calendar */
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)) {
t = &cur_time_params;
v = ¤t_view;
- printf(" Updating Sun position\n");
+ FG_LOG( FG_TIME, FG_INFO, " Updating Sun position" );
// (not sure why there was two)
// fgSunPosition(t->cur_time, &l->sun_lon, &sun_gd_lat);
p = Point3D( l->sun_lon, l->sun_gc_lat, sl_radius );
l->fg_sunpos = fgPolarToCart3d(p);
- printf( " t->cur_time = %ld\n", t->cur_time);
- printf( " Sun Geodetic lat = %.5f Geocentric lat = %.5f\n",
- sun_gd_lat, l->sun_gc_lat);
+ FG_LOG( FG_TIME, FG_INFO, " t->cur_time = " << t->cur_time );
+ FG_LOG( FG_TIME, FG_INFO,
+ " Sun Geodetic lat = " << sun_gd_lat
+ << " Geocentric lat = " << l->sun_gc_lat );
// I think this will work better for generating the sun light vector
l->sun_vec[0] = l->fg_sunpos.x();
// $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
// Point3D tweaks.
//