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
src/Main
|
@ -288,6 +288,8 @@ int main ( int argc, char **argv )
|
||||||
if (flightgear::Options::checkForArg(argc, argv, "uninstall")) {
|
if (flightgear::Options::checkForArg(argc, argv, "uninstall")) {
|
||||||
return fgUninstall();
|
return fgUninstall();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::cerr << "Boostrap-1" << std::endl;
|
||||||
|
|
||||||
bool fgviewer = flightgear::Options::checkForArg(argc, argv, "fgviewer");
|
bool fgviewer = flightgear::Options::checkForArg(argc, argv, "fgviewer");
|
||||||
int exitStatus = EXIT_FAILURE;
|
int exitStatus = EXIT_FAILURE;
|
||||||
|
@ -307,6 +309,9 @@ int main ( int argc, char **argv )
|
||||||
#endif
|
#endif
|
||||||
std::set_terminate(fg_terminate);
|
std::set_terminate(fg_terminate);
|
||||||
atexit(fgExitCleanup);
|
atexit(fgExitCleanup);
|
||||||
|
|
||||||
|
std::cerr << "Boostrap-2" << std::endl;
|
||||||
|
|
||||||
if (fgviewer) {
|
if (fgviewer) {
|
||||||
exitStatus = fgviewerMain(argc, argv);
|
exitStatus = fgviewerMain(argc, argv);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -521,7 +521,9 @@ static void rotateOldLogFiles()
|
||||||
if (!p.exists())
|
if (!p.exists())
|
||||||
return;
|
return;
|
||||||
SGPath log0Path = homePath / "fgfs_0.log";
|
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)
|
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");
|
"Flightgear was unable to create the lock file in FG_HOME");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::cerr << "DidInitHome" << std::endl;
|
||||||
|
|
||||||
|
|
||||||
#if defined(HAVE_QT)
|
#if defined(HAVE_QT)
|
||||||
flightgear::initApp(argc, argv);
|
flightgear::initApp(argc, argv);
|
||||||
#endif
|
#endif
|
||||||
|
@ -587,10 +592,12 @@ int fgMainInit( int argc, char **argv )
|
||||||
// now home is initialised, we can log to a file inside it
|
// now home is initialised, we can log to a file inside it
|
||||||
const auto level = flightgear::Options::getArgValue(argc, argv, "--log-level");
|
const auto level = flightgear::Options::getArgValue(argc, argv, "--log-level");
|
||||||
logToHome(level);
|
logToHome(level);
|
||||||
|
std::cerr << "DidLogToHome" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (readOnlyFGHome) {
|
if (readOnlyFGHome) {
|
||||||
flightgear::addSentryTag("fghome-readonly", "true");
|
flightgear::addSentryTag("fghome-readonly", "true");
|
||||||
|
std::cerr << "Read-Only-Home" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string version(FLIGHTGEAR_VERSION);
|
std::string version(FLIGHTGEAR_VERSION);
|
||||||
|
|
Loading…
Add table
Reference in a new issue