diff options
Diffstat (limited to 'cpp/src/IceGrid/TraceLevels.cpp')
-rw-r--r-- | cpp/src/IceGrid/TraceLevels.cpp | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/cpp/src/IceGrid/TraceLevels.cpp b/cpp/src/IceGrid/TraceLevels.cpp index d2a4c6944c0..39b71017c86 100644 --- a/cpp/src/IceGrid/TraceLevels.cpp +++ b/cpp/src/IceGrid/TraceLevels.cpp @@ -13,36 +13,28 @@ using namespace std; using namespace IceGrid; -TraceLevels::TraceLevels(const Ice::PropertiesPtr& properties, const Ice::LoggerPtr& theLogger) : +TraceLevels::TraceLevels(const Ice::PropertiesPtr& properties, const Ice::LoggerPtr& theLogger, bool isNode) : + application(0), + applicationCat("Application"), + node(0), + nodeCat("Node"), server(0), serverCat("Server"), adapter(0), adapterCat("Adapter"), + object(0), + objectCat("Object"), activator(0), activatorCat("Activator"), - applicationRegistry(0), - applicationRegistryCat("ApplicationRegistry"), - serverRegistry(0), - serverRegistryCat("ServerRegistry"), - adapterRegistry(0), - adapterRegistryCat("AdapterRegistry"), - objectRegistry(0), - objectRegistryCat("ObjectRegistry"), - nodeRegistry(0), - nodeRegistryCat("NodeRegistry"), logger(theLogger) { - const string nodeKeyBase = "IceGrid.Node.Trace."; - const_cast<int&>(server) = properties->getPropertyAsInt(nodeKeyBase + serverCat); - const_cast<int&>(adapter) = properties->getPropertyAsInt(nodeKeyBase + adapterCat); - const_cast<int&>(activator) = properties->getPropertyAsInt(nodeKeyBase + activatorCat); - - const string registryKeyBase = "IceGrid.Registry.Trace."; - const_cast<int&>(applicationRegistry) = properties->getPropertyAsInt(registryKeyBase + applicationRegistryCat); - const_cast<int&>(serverRegistry) = properties->getPropertyAsInt(registryKeyBase + serverRegistryCat); - const_cast<int&>(adapterRegistry) = properties->getPropertyAsInt(registryKeyBase + adapterRegistryCat); - const_cast<int&>(objectRegistry) = properties->getPropertyAsInt(registryKeyBase + objectRegistryCat); - const_cast<int&>(nodeRegistry) = properties->getPropertyAsInt(registryKeyBase + nodeRegistryCat); + string keyBase = isNode ? "IceGrid.Node." : "IceGrid.Registry."; + const_cast<int&>(application) = properties->getPropertyAsInt(keyBase + applicationCat); + const_cast<int&>(node) = properties->getPropertyAsInt(keyBase + nodeCat); + const_cast<int&>(server) = properties->getPropertyAsInt(keyBase + serverCat); + const_cast<int&>(adapter) = properties->getPropertyAsInt(keyBase + adapterCat); + const_cast<int&>(object) = properties->getPropertyAsInt(keyBase + objectCat); + const_cast<int&>(activator) = properties->getPropertyAsInt(keyBase + activatorCat); } TraceLevels::~TraceLevels() |