diff --git a/pvAccessApp/remote/abstractResponseHandler.cpp b/pvAccessApp/remote/abstractResponseHandler.cpp index 2d36e1f..4c7c0ec 100644 --- a/pvAccessApp/remote/abstractResponseHandler.cpp +++ b/pvAccessApp/remote/abstractResponseHandler.cpp @@ -24,7 +24,7 @@ namespace epics { void AbstractResponseHandler::handleResponse(osiSockAddr* responseFrom, Transport::shared_pointer const & /*transport*/, int8 version, int8 command, size_t payloadSize, ByteBuffer* payloadBuffer) { - if(_debug) { + if(_debugLevel >= 3) { // TODO make a constant of sth (0 - off, 1 - debug, 2 - more/trace, 3 - messages) char ipAddrStr[48]; ipAddrToDottedIP(&responseFrom->ia, ipAddrStr, sizeof(ipAddrStr)); diff --git a/pvAccessApp/remote/remote.h b/pvAccessApp/remote/remote.h index 7999293..5a53b3a 100644 --- a/pvAccessApp/remote/remote.h +++ b/pvAccessApp/remote/remote.h @@ -352,7 +352,7 @@ namespace epics { */ AbstractResponseHandler(Context* context, epics::pvData::String description) : _description(description), - _debug(context->getConfiguration()->getPropertyAsBoolean(PVACCESS_DEBUG, false)) { + _debugLevel(context->getConfiguration()->getPropertyAsInteger(PVACCESS_DEBUG, 0)) { } virtual ~AbstractResponseHandler() {} @@ -370,7 +370,7 @@ namespace epics { /** * Debug flag. */ - bool _debug; + epics::pvData::int32 _debugLevel; }; /** diff --git a/pvAccessApp/remoteClient/clientContextImpl.cpp b/pvAccessApp/remoteClient/clientContextImpl.cpp index cbc26da..fef1fbe 100644 --- a/pvAccessApp/remoteClient/clientContextImpl.cpp +++ b/pvAccessApp/remoteClient/clientContextImpl.cpp @@ -4037,6 +4037,12 @@ TODO private: void loadConfiguration() { + + // TODO for now just a simple switch + int32 debugLevel = m_configuration->getPropertyAsInteger(PVACCESS_DEBUG, 0); + if (debugLevel > 0) + SET_LOG_LEVEL(logLevelDebug); + m_addressList = m_configuration->getPropertyAsString("EPICS_PVA_ADDR_LIST", m_addressList); m_autoAddressList = m_configuration->getPropertyAsBoolean("EPICS_PVA_AUTO_ADDR_LIST", m_autoAddressList); m_connectionTimeout = m_configuration->getPropertyAsFloat("EPICS_PVA_CONN_TMO", m_connectionTimeout); diff --git a/pvAccessApp/server/serverContext.cpp b/pvAccessApp/server/serverContext.cpp index c357d23..67995f0 100644 --- a/pvAccessApp/server/serverContext.cpp +++ b/pvAccessApp/server/serverContext.cpp @@ -98,6 +98,11 @@ void ServerContextImpl::loadConfiguration() { Configuration::shared_pointer config = getConfiguration(); + // TODO for now just a simple switch + int32 debugLevel = config->getPropertyAsInteger(PVACCESS_DEBUG, 0); + if (debugLevel > 0) + SET_LOG_LEVEL(logLevelDebug); + _beaconAddressList = config->getPropertyAsString("EPICS_PVA_ADDR_LIST", _beaconAddressList); _beaconAddressList = config->getPropertyAsString("EPICS_PVAS_BEACON_ADDR_LIST", _beaconAddressList);