COMMON: Persist global debug channels between engine runs
This commit is contained in:
parent
fef26b3c59
commit
83fc4f7338
2 changed files with 10 additions and 0 deletions
|
@ -157,6 +157,7 @@ private:
|
||||||
|
|
||||||
DebugChannelMap _debugChannels;
|
DebugChannelMap _debugChannels;
|
||||||
uint32 _debugChannelsEnabled;
|
uint32 _debugChannelsEnabled;
|
||||||
|
uint32 _globalChannelsMask;
|
||||||
|
|
||||||
friend class Singleton<SingletonBaseType>;
|
friend class Singleton<SingletonBaseType>;
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,12 @@ struct DebugLevelComperator {
|
||||||
DebugManager::DebugManager() :
|
DebugManager::DebugManager() :
|
||||||
_debugChannelsEnabled(0) {
|
_debugChannelsEnabled(0) {
|
||||||
addDebugChannels(gDebugChannels);
|
addDebugChannels(gDebugChannels);
|
||||||
|
|
||||||
|
// Create global debug channels mask
|
||||||
|
_globalChannelsMask = 0;
|
||||||
|
for (uint i = 0; gDebugChannels[i].channel != 0; ++i) {
|
||||||
|
_globalChannelsMask |= gDebugChannels[i].channel;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DebugManager::addDebugChannel(uint32 channel, const String &name, const String &description) {
|
bool DebugManager::addDebugChannel(uint32 channel, const String &name, const String &description) {
|
||||||
|
@ -83,9 +89,12 @@ void DebugManager::addAllDebugChannels(const DebugChannelDef *channels) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DebugManager::removeAllDebugChannels() {
|
void DebugManager::removeAllDebugChannels() {
|
||||||
|
uint32 globalChannels = _debugChannelsEnabled & _globalChannelsMask;
|
||||||
_debugChannelsEnabled = 0;
|
_debugChannelsEnabled = 0;
|
||||||
_debugChannels.clear();
|
_debugChannels.clear();
|
||||||
addDebugChannels(gDebugChannels);
|
addDebugChannels(gDebugChannels);
|
||||||
|
|
||||||
|
_debugChannelsEnabled |= globalChannels;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DebugManager::enableDebugChannel(const String &name) {
|
bool DebugManager::enableDebugChannel(const String &name) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue