David,
It sounds like you are bypassing SG_LOG() because it isn't doing what
you want. This seems like a bandaid solution at best. Perhaps we
should put these messages back in as SG_LOG( SG_ALERT ) and then
default 'release' builds to a minimum logging level of SG_ALERT rather
than collapsing SG_LOG into nothing as we do now.
It would be nice to be able to maintain a consistant approach
throughout the project.
Curt.
David Megginson writes:
> Update of /var/cvs/FlightGear-0.7/FlightGear/src/Main
> In directory seneca:/tmp/cvs-serv1516/src/Main
>
> Modified Files:
> fg_init.cxx main.cxx options.cxx
> Log Message:
> Let exceptions fall through to main, and use cerr to report them (in
> case logging is disabled). This way, when people specify a
> non-existant aircraft or have an error in a custom XML file, they'll
> get an error report, at least.
>
>
> Index: fg_init.cxx
> ===================================================================
> RCS file: /var/cvs/FlightGear-0.7/FlightGear/src/Main/fg_init.cxx,v
> retrieving revision 1.161
> retrieving revision 1.162
> diff -C2 -r1.161 -r1.162
> *** fg_init.cxx 3 Apr 2002 21:54:45 -0000 1.161
> --- fg_init.cxx 4 Apr 2002 15:51:40 -0000 1.162
> ***************
> *** 232,243 ****
> props_path.append("preferences.xml");
> SG_LOG(SG_INPUT, SG_INFO, "Reading global preferences");
> ! try {
> ! readProperties(props_path.str(), globals->get_props());
> ! } catch (const sg_exception &e) {
> ! string message = "Error reading global preferences: ";
> ! message += e.getFormattedMessage();
> ! SG_LOG(SG_INPUT, SG_ALERT, message);
> ! exit(2);
> ! }
> SG_LOG(SG_INPUT, SG_INFO, "Finished Reading global preferences");
>
> --- 232,236 ----
> props_path.append("preferences.xml");
> SG_LOG(SG_INPUT, SG_INFO, "Reading global preferences");
> ! readProperties(props_path.str(), globals->get_props());
> SG_LOG(SG_INPUT, SG_INFO, "Finished Reading global preferences");
>
>
> Index: main.cxx
> ===================================================================
> RCS file: /var/cvs/FlightGear-0.7/FlightGear/src/Main/main.cxx,v
> retrieving revision 1.270
> retrieving revision 1.271
> diff -C2 -r1.270 -r1.271
> *** main.cxx 4 Apr 2002 03:03:18 -0000 1.270
> --- main.cxx 4 Apr 2002 15:51:40 -0000 1.271
> ***************
> *** 32,35 ****
> --- 32,40 ----
>
> #include <simgear/compiler.h>
> +
> + #include <iostream>
> + SG_USING_STD(cerr);
> + SG_USING_STD(endl);
> +
> #include <simgear/misc/exception.hxx>
> #include <simgear/ephemeris/ephemeris.hxx>
> ***************
> *** 1599,1605 ****
> mainLoop(argc, argv);
> } catch (sg_throwable &t) {
> ! SG_LOG(SG_GENERAL, SG_ALERT,
> ! "Fatal error: " << t.getFormattedMessage()
> ! << "\n (received from " << t.getOrigin() << ')');
> exit(1);
> }
> --- 1604,1612 ----
> mainLoop(argc, argv);
> } catch (sg_throwable &t) {
> ! // We must use cerr rather than
> ! // logging, since logging may be
> ! // disabled.
> ! cerr << "Fatal error: " << t.getFormattedMessage()
> ! << "\n (received from " << t.getOrigin() << ')' << endl;
> exit(1);
> }
>
> Index: options.cxx
> ===================================================================
> RCS file: /var/cvs/FlightGear-0.7/FlightGear/src/Main/options.cxx,v
> retrieving revision 1.158
> retrieving revision 1.159
> diff -C2 -r1.158 -r1.159
> *** options.cxx 26 Mar 2002 01:38:15 -0000 1.158
> --- options.cxx 4 Apr 2002 15:51:40 -0000 1.159
> ***************
> *** 943,954 ****
> SG_LOG(SG_INPUT, SG_INFO, "Reading aircraft: " << arg.substr(11)
> << " from " << apath.str());
> ! try {
> ! readProperties( apath.str(), globals->get_props() );
> ! } catch (const sg_exception &e) {
> ! string message = "Error loading aircraft file: ";
> ! message += e.getFormattedMessage();
> ! SG_LOG(SG_INPUT, SG_ALERT, message);
> ! exit(2);
> ! }
> } else {
> SG_LOG( SG_GENERAL, SG_ALERT, "Unknown option '" << arg << "'" );
> --- 943,947 ----
> SG_LOG(SG_INPUT, SG_INFO, "Reading aircraft: " << arg.substr(11)
> << " from " << apath.str());
> ! readProperties( apath.str(), globals->get_props() );
> } else {
> SG_LOG( SG_GENERAL, SG_ALERT, "Unknown option '" << arg << "'" );
>
>
> _______________________________________________
> Flightgear-cvslogs mailing list
> [EMAIL PROTECTED]
> http://mail.flightgear.org/mailman/listinfo/flightgear-cvslogs
--
Curtis Olson IVLab / HumanFIRST Program FlightGear Project
Twin Cities [EMAIL PROTECTED] [EMAIL PROTECTED]
Minnesota http://www.menet.umn.edu/~curt http://www.flightgear.org
_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel