Crude startup logging.
To diagnose startup hang, will revert once we have fix the issue.
This commit is contained in:
parent
58f0b4a16a
commit
dfcae619cf
2 changed files with 13 additions and 1 deletions
|
@ -288,6 +288,8 @@ int main ( int argc, char **argv )
|
|||
if (flightgear::Options::checkForArg(argc, argv, "uninstall")) {
|
||||
return fgUninstall();
|
||||
}
|
||||
|
||||
std::cerr << "Boostrap-1" << std::endl;
|
||||
|
||||
bool fgviewer = flightgear::Options::checkForArg(argc, argv, "fgviewer");
|
||||
int exitStatus = EXIT_FAILURE;
|
||||
|
@ -307,6 +309,9 @@ int main ( int argc, char **argv )
|
|||
#endif
|
||||
std::set_terminate(fg_terminate);
|
||||
atexit(fgExitCleanup);
|
||||
|
||||
std::cerr << "Boostrap-2" << std::endl;
|
||||
|
||||
if (fgviewer) {
|
||||
exitStatus = fgviewerMain(argc, argv);
|
||||
} else {
|
||||
|
|
|
@ -521,7 +521,9 @@ static void rotateOldLogFiles()
|
|||
if (!p.exists())
|
||||
return;
|
||||
SGPath log0Path = homePath / "fgfs_0.log";
|
||||
p.rename(log0Path);
|
||||
if (!p.rename(log0Path)) {
|
||||
std::cerr << "Failed to rename " << p.str() << " to " << log0Path.str() << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
static void logToHome(const std::string& pri)
|
||||
|
@ -558,6 +560,9 @@ int fgMainInit( int argc, char **argv )
|
|||
"Flightgear was unable to create the lock file in FG_HOME");
|
||||
}
|
||||
|
||||
std::cerr << "DidInitHome" << std::endl;
|
||||
|
||||
|
||||
#if defined(HAVE_QT)
|
||||
flightgear::initApp(argc, argv);
|
||||
#endif
|
||||
|
@ -587,10 +592,12 @@ int fgMainInit( int argc, char **argv )
|
|||
// now home is initialised, we can log to a file inside it
|
||||
const auto level = flightgear::Options::getArgValue(argc, argv, "--log-level");
|
||||
logToHome(level);
|
||||
std::cerr << "DidLogToHome" << std::endl;
|
||||
}
|
||||
|
||||
if (readOnlyFGHome) {
|
||||
flightgear::addSentryTag("fghome-readonly", "true");
|
||||
std::cerr << "Read-Only-Home" << std::endl;
|
||||
}
|
||||
|
||||
std::string version(FLIGHTGEAR_VERSION);
|
||||
|
|
Loading…
Add table
Reference in a new issue