core: (fixes #857): Handle default levels when log component is merely mentioned.

This commit is contained in:
Peter D. Barnes, Jr
2023-01-20 13:52:08 -08:00
committed by Peter Barnes
parent edafe76036
commit e12f062188

View File

@@ -181,11 +181,17 @@ LogComponent::EnvVarCheck()
std::tie(found, value) = EnvironmentVariable::Get("NS_LOG", "***", ":");
}
if (!found || value.empty())
if (!found)
{
return;
}
if (value.empty())
{
// Default is enable all levels, all prefixes
value = "**";
}
// Got a value, might have flags
int level = 0;
StringVector flags = SplitString(value, "|");