Skip to content

Commit e9fa1b7

Browse files
committed
WIP
Signed-off-by: Dave Streeter <[email protected]>
1 parent 5896e37 commit e9fa1b7

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

system/jlib/jlog.cpp

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2381,7 +2381,7 @@ static Singleton<bool> firstUpdateConfigHookCall;
23812381
static bool firstUpdateConfigHookCallValue{true};
23822382
bool queryFirstUpdateConfigHookCall()
23832383
{
2384-
return *firstUpdateConfigHookCall.query([] () { return &firstUpdateConfigHookCallValue; });;
2384+
return *firstUpdateConfigHookCall.query([] () { return &firstUpdateConfigHookCallValue; });
23852385
}
23862386

23872387
auto updateConfigFunc = [](const IPropertyTree *oldComponentConfiguration, const IPropertyTree *oldGlobalConfiguration)
@@ -2390,15 +2390,17 @@ auto updateConfigFunc = [](const IPropertyTree *oldComponentConfiguration, const
23902390
};
23912391
static CConfigUpdateHook configUpdateHook;
23922392
// NOTE: The parameter updateConfigOnTheFly value of true signifies that the thread
2393-
// safe caller has completed setting up the logging configuration and that
2394-
// any further configuration changes are from non-thread safe callers.
2395-
void setupContainerizedLogMsgHandler(bool updateConfigOnTheFly)
2396-
{
2397-
// NOTE: We need to allow the first config update hook call to update the config
2398-
// as if it was not called from the config update hook.
2399-
// This is to allow the configuration to be setup by the thread safe caller.
2400-
// In practice this means allowing 2 calls to setupContainerizedLogMsgHandler
2401-
// before the update config hook is allowed to prevent on the fly format changes.
2393+
// safe caller has completed setting up the logging configuration (normally
2394+
// from a main call).
2395+
// Any further configuration changes are from non-thread safe callers.
2396+
// EXCEPT: There are 2 calls to setupContainerizedLogMsgHandler that are
2397+
// thread-safe. In order to allow them to change the log format (if required)
2398+
// etc we need to allow the first config update hook call to update the config
2399+
// as if it was not called from the config update hook.
2400+
void setupContainerizedLogMsgHandler(bool updateConfigOnTheFly)
2401+
{
2402+
// Alow the first config update hook call to update the config as if it was not
2403+
// called from the config update hook to allow log configuration changes.
24022404
if(updateConfigOnTheFly && queryFirstUpdateConfigHookCall())
24032405
{
24042406
firstUpdateConfigHookCallValue = false;

0 commit comments

Comments
 (0)