Log to file inside FG_HOME.
This commit is contained in:
parent
240f98d0f3
commit
0ced6a24a0
1 changed files with 12 additions and 0 deletions
|
@ -314,6 +314,18 @@ int fgMainInit( int argc, char **argv ) {
|
|||
exit(-1);
|
||||
}
|
||||
|
||||
SGPath logPath = globals->get_fg_home();
|
||||
logPath.append("fgfs.log");
|
||||
if (logPath.exists()) {
|
||||
SGPath prevLogPath = globals->get_fg_home();
|
||||
prevLogPath.append("fgfs_0.log");
|
||||
logPath.rename(prevLogPath);
|
||||
// bit strange, we need to restore the correct value of logPath now
|
||||
logPath = globals->get_fg_home();
|
||||
logPath.append("fgfs.log");
|
||||
}
|
||||
sglog().logToFile(logPath, SG_ALL, SG_INFO);
|
||||
|
||||
// Initialize the Window/Graphics environment.
|
||||
fgOSInit(&argc, argv);
|
||||
_bootstrap_OSInit++;
|
||||
|
|
Loading…
Add table
Reference in a new issue