Skip to content

Commit ec91536

Browse files
committed
registry control of service verbose modules
1 parent 4cfde58 commit ec91536

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

IntelPresentMon/CommonUtilities/log/GlobalPolicy.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,22 @@ namespace pmon::util::log
7979
}
8080
void GlobalPolicy::ActivateVerboseModule(V mod) noexcept
8181
{
82-
activeVerboseModules_ |= (1 << int(mod));
82+
activeVerboseModules_ |= (1ull << uint64_t(mod));
8383
}
8484
void GlobalPolicy::DeactivateVerboseModule(V mod) noexcept
8585
{
86-
activeVerboseModules_ &= ~(1 << int(mod));
86+
activeVerboseModules_ &= ~(1ull << uint64_t(mod));
8787
}
8888
bool GlobalPolicy::CheckVerboseModule(V mod) const noexcept
8989
{
90-
return activeVerboseModules_ & (1 << int(mod));
90+
return activeVerboseModules_ & (1ull << uint64_t(mod));
9191
}
9292
void GlobalPolicy::ClearVerboseModules() noexcept
9393
{
9494
activeVerboseModules_ = 0;
9595
}
96+
void GlobalPolicy::StoreVerboseModules(uint64_t modset) noexcept
97+
{
98+
activeVerboseModules_.store(modset);
99+
}
96100
}

IntelPresentMon/CommonUtilities/log/GlobalPolicy.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ namespace pmon::util::log
2727
void DeactivateVerboseModule(V mod) noexcept;
2828
bool CheckVerboseModule(V mod) const noexcept;
2929
void ClearVerboseModules() noexcept;
30+
void StoreVerboseModules(uint64_t modset) noexcept;
3031
static GlobalPolicy& Get() noexcept;
3132
static bool VCheck(V mod) noexcept
3233
{

IntelPresentMon/PresentMonService/LogSetup.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,21 @@ namespace logsetup
7171
// shortcuts for command line and registry
7272
const auto& opt = clio::Options::Get();
7373
const auto& reg = Reg::Get();
74+
auto& pol = GlobalPolicy::Get();
7475
// get the channel
7576
auto pChannel = GetDefaultChannel();
7677
// configure logging based on command line
7778
if (opt.logLevel || reg.logLevel.Exists()) {
78-
GlobalPolicy::Get().SetLogLevel(opt.logLevel ? *opt.logLevel : reg.logLevel);
79+
pol.SetLogLevel(opt.logLevel ? *opt.logLevel : reg.logLevel);
7980
}
8081
if (opt.logVerboseModules) {
8182
for (auto mod : *opt.logVerboseModules) {
82-
GlobalPolicy::Get().ActivateVerboseModule(mod);
83+
pol.ActivateVerboseModule(mod);
8384
}
8485
}
86+
else if (reg.logVerboseModules.Exists()) {
87+
pol.StoreVerboseModules(reg.logVerboseModules);
88+
}
8589
if (!opt.enableStdioLog) {
8690
pChannel->AttachComponent({}, "drv:std");
8791
}

IntelPresentMon/PresentMonService/Registry.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ struct Reg : public reg::RegistryBase<Reg, HKEY_LOCAL_MACHINE>
99
Value<log::Level> logLevel{ this, "logLevel" };
1010
Value<std::string> logDir{ this, "logDir" };
1111
Value<std::string> middlewarePath{ this, pmon::gid::middlewarePathKey };
12+
Value<uint64_t> logVerboseModules{ this, "logVerboseModules" };
1213

1314
static constexpr const wchar_t* keyPath_ = pmon::gid::registryPath;
1415
};

0 commit comments

Comments
 (0)