SGPath props_path(globals->get_fg_root());
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);
- }
+ readProperties(props_path.str(), globals->get_props());
SG_LOG(SG_INPUT, SG_INFO, "Finished Reading global preferences");
// Read the default aircraft config file.
#endif
#include <simgear/compiler.h>
+
+#include <iostream>
+SG_USING_STD(cerr);
+SG_USING_STD(endl);
+
#include <simgear/misc/exception.hxx>
#include <simgear/ephemeris/ephemeris.hxx>
#include <simgear/route/route.hxx>
try {
mainLoop(argc, argv);
} catch (sg_throwable &t) {
- SG_LOG(SG_GENERAL, SG_ALERT,
- "Fatal error: " << t.getFormattedMessage()
- << "\n (received from " << t.getOrigin() << ')');
+ // 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);
}
apath.concat( "-set.xml" );
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);
- }
+ readProperties( apath.str(), globals->get_props() );
} else {
SG_LOG( SG_GENERAL, SG_ALERT, "Unknown option '" << arg << "'" );
return FG_OPTIONS_ERROR;