1
0
Fork 0

src/Main/fg_init.cxx: use /sim/log-file-line to control output of file:line in logs.

We call sglog().setFileLine() in response to changes to /sim/log-file-line.
This commit is contained in:
Julian Smith 2019-09-01 15:08:34 +01:00
parent 10414fada4
commit 335547160c

View file

@ -532,6 +532,17 @@ static void createBaseStorageDirForAddons(const SGPath& exportDir)
} }
} }
struct SimLogFileLine : SGPropertyChangeListener
{
SimLogFileLine() {
fgAddChangeListener(this, "/sim/log-file-line");
}
virtual void valueChanged(SGPropertyNode* node) {
bool fileLine = node->getBoolValue();
sglog().setFileLine(fileLine);
}
};
// Read in configuration (file and command line) // Read in configuration (file and command line)
int fgInitConfig ( int argc, char **argv, bool reinit ) int fgInitConfig ( int argc, char **argv, bool reinit )
{ {
@ -575,6 +586,8 @@ int fgInitConfig ( int argc, char **argv, bool reinit )
fgSetBool("/sim/developer-mode", developerMode); fgSetBool("/sim/developer-mode", developerMode);
sglog().setDeveloperMode(developerMode); sglog().setDeveloperMode(developerMode);
static SimLogFileLine simLogFileLine;
#ifdef ENABLE_SWIFT #ifdef ENABLE_SWIFT
//Set standard settings for swift connection //Set standard settings for swift connection