diff --git a/slsDetectorServers/slsDetectorServer/src/TCPInterface.cpp b/slsDetectorServers/slsDetectorServer/src/TCPInterface.cpp index 7a9e02105..3d1bc276e 100644 --- a/slsDetectorServers/slsDetectorServer/src/TCPInterface.cpp +++ b/slsDetectorServers/slsDetectorServer/src/TCPInterface.cpp @@ -29,7 +29,6 @@ void TCPInterface::startTCPServer() { int function_id{}; // TODO should it be an enum type while (true) { - LOG(logDEBUG1) << "Start accept loop"; try { auto socket = server.accept(); try { diff --git a/slsDetectorSoftware/src/Detector.cpp b/slsDetectorSoftware/src/Detector.cpp index d0d721ac2..070c24b64 100644 --- a/slsDetectorSoftware/src/Detector.cpp +++ b/slsDetectorSoftware/src/Detector.cpp @@ -174,20 +174,17 @@ Result Detector::getHostname(Positions pos) const { } void Detector::setHostname(const std::vector &hostname) { - LOG(logINFORED) << "test"; - LOG(logDEBUG) << "Checking if hostname is already in shared memory"; if (pimpl->hasModulesInSharedMemory()) { LOG(logWARNING) << "There are already module(s) in shared memory." "Freeing Shared memory now."; auto numChannels = getDetectorSize(); - LOG(logDEBUG) << "Current detector size: " << numChannels; auto initialChecks = getInitialChecks(); freeSharedMemory(getShmId()); pimpl = make_unique(getShmId()); setDetectorSize(numChannels); setInitialChecks(initialChecks); } - LOG(logDEBUG) << "not in shared memory yet, setting hostname"; + LOG(logDEBUG3) << "not in shared memory yet, setting hostname"; pimpl->setHostname(hostname); } diff --git a/slsDetectorSoftware/src/DetectorImpl.cpp b/slsDetectorSoftware/src/DetectorImpl.cpp index 8451874b1..ff855d0b4 100644 --- a/slsDetectorSoftware/src/DetectorImpl.cpp +++ b/slsDetectorSoftware/src/DetectorImpl.cpp @@ -193,8 +193,6 @@ void DetectorImpl::setHostname(const std::vector &name) { } ctb_shm.createSharedMemory(); } - - LOG(logDEBUG) << "created shared memory"; } void DetectorImpl::addModule(const std::string &name) { @@ -206,9 +204,6 @@ void DetectorImpl::addModule(const std::string &name) { // get type by connecting detectorType type = Module::getTypeFromDetector(hostname, port); - LOG(logDEBUG) << "Detector type of module " << name << " is " - << std::to_string(type); - // gotthard2 cannot have more than 2 modules (50um=1, 25um=2 if (type == GOTTHARD2 && modules.size() > 2) { throw RuntimeError("GotthardII cannot have more than 2 modules. Please " diff --git a/slsDetectorSoftware/src/Module.cpp b/slsDetectorSoftware/src/Module.cpp index a5c49492a..baa35fa04 100644 --- a/slsDetectorSoftware/src/Module.cpp +++ b/slsDetectorSoftware/src/Module.cpp @@ -85,20 +85,17 @@ std::string Module::getControlServerLongVersion() const { // throw with old server version (sends 8 bytes) catch (RuntimeError &e) { std::string emsg = std::string(e.what()); - LOG(logDEBUG) << "Error message: " << emsg; - /* if (emsg.find(F_GET_SERVER_VERSION) && emsg.find("8 bytes")) { throwDeprecatedServerVersion(); } - */ throw; } } void Module::throwDeprecatedServerVersion() const { - LOG(logDEBUG1) << "throw deprecated version error"; + LOG(logDEBUG3) << "throw deprecated version error"; uint64_t res = sendToDetectorStop(F_GET_SERVER_VERSION); std::cout << std::endl; std::ostringstream os; @@ -108,7 +105,6 @@ void Module::throwDeprecatedServerVersion() const { } std::string Module::getStopServerLongVersion() const { - LOG(logDEBUG1) << "Getting Stop Server Version"; char retval[MAX_STR_LENGTH]{}; sendToDetectorStop(F_GET_SERVER_VERSION, nullptr, retval); return retval; @@ -152,8 +148,6 @@ std::string Module::getReceiverSoftwareVersion() const { slsDetectorDefs::detectorType Module::getTypeFromDetector(const std::string &hostname, uint16_t cport) { LOG(logDEBUG1) << "Getting Module type "; - LOG(logDEBUG1) << "ClientSocket: Hostname: " << hostname - << " Port: " << cport; ClientSocket socket("Detector", hostname, cport); socket.Send(F_GET_DETECTOR_TYPE); socket.setFnum(F_GET_DETECTOR_TYPE); @@ -3062,10 +3056,7 @@ void Module::sendToDetector(int fnum, const void *args, size_t args_size, // the other versions use templates to deduce sizes and create // the return type checkArgs(args, args_size, retval, retval_size); - LOG(logDEBUG1) << "Creating DetectorSocket on: " << shm()->hostname << ":" - << shm()->controlPort; auto client = DetectorSocket(shm()->hostname, shm()->controlPort); - LOG(logDEBUG1) << "sending command then read to DetectorSocket"; client.sendCommandThenRead(fnum, args, args_size, retval, retval_size); client.close(); } @@ -3177,10 +3168,8 @@ void Module::sendToDetectorStop(int fnum, const void *args, size_t args_size, // This is the only function that actually sends data to the detector stop // the other versions use templates to deduce sizes and create // the return type - LOG(logINFORED) << "Sending command to Detector Stop Socket"; checkArgs(args, args_size, retval, retval_size); auto stop = DetectorSocket(shm()->hostname, shm()->stopPort); - LOG(logDEBUG1) << "sending command then read to Detector Stop Socket"; stop.sendCommandThenRead(fnum, args, args_size, retval, retval_size); stop.close(); } @@ -3303,7 +3292,6 @@ void Module::sendToReceiver(int fnum, const void *args, size_t args_size, } checkArgs(args, args_size, retval, retval_size); auto receiver = ReceiverSocket(shm()->rxHostname, shm()->rxTCPPort); - LOG(logDEBUG1) << "sending command then read to ReceiverSocket"; receiver.sendCommandThenRead(fnum, args, args_size, retval, retval_size); receiver.close(); } @@ -3485,7 +3473,7 @@ void Module::checkDetectorVersionCompatibility() { LOG(logDEBUG) << "Checking detector version compatibility with client..."; std::string detServers[2] = {getControlServerLongVersion(), getStopServerLongVersion()}; - LOG(logINFO) + LOG(logDEBUG1) << "Checking detector version compatibility with client version " << detServers[0] << " and " << detServers[1]; for (int i = 0; i != 2; ++i) { diff --git a/slsReceiverSoftware/src/ClientInterface.cpp b/slsReceiverSoftware/src/ClientInterface.cpp index 133a12cc9..0c08534a8 100644 --- a/slsReceiverSoftware/src/ClientInterface.cpp +++ b/slsReceiverSoftware/src/ClientInterface.cpp @@ -85,7 +85,6 @@ void ClientInterface::startTCPServer() { << '\n'; while (!killTcpThread) { - LOG(logDEBUG1) << "Start accept loop"; try { auto socket = server.accept(); try { diff --git a/slsSupportLib/src/ClientSocket.cpp b/slsSupportLib/src/ClientSocket.cpp index d5e908e1e..94650b0f0 100644 --- a/slsSupportLib/src/ClientSocket.cpp +++ b/slsSupportLib/src/ClientSocket.cpp @@ -67,9 +67,7 @@ int ClientSocket::sendCommandThenRead(int fnum, const void *args, int ret = slsDetectorDefs::FAIL; Send(&fnum, sizeof(fnum)); setFnum(fnum); - LOG(logDEBUG1) << "Sent command fnum: " << fnum << " to " << socketType; Send(args, args_size); - LOG(logDEBUG1) << "About to read reply"; readReply(ret, retval, retval_size); return ret; } @@ -78,7 +76,6 @@ void ClientSocket::readReply(int &ret, void *retval, size_t retval_size) { try { Receive(&ret, sizeof(ret)); - // Receive() if (ret == slsDetectorDefs::FAIL) { std::string mess = readErrorMessage(); // Do we need to know hostname here? diff --git a/slsSupportLib/src/DataSocket.cpp b/slsSupportLib/src/DataSocket.cpp index 308913811..25d016d0b 100644 --- a/slsSupportLib/src/DataSocket.cpp +++ b/slsSupportLib/src/DataSocket.cpp @@ -50,8 +50,6 @@ int DataSocket::Receive(void *buffer, size_t size) { // TODO!(Erik) Add sleep? how many reties? int bytes_expected = static_cast(size); // signed size int bytes_read = 0; - LOG(logDEBUG1) << "Should receive " << bytes_expected - << " bytes on socket "; while (bytes_read < bytes_expected) { auto this_read = ::read(getSocketId(), reinterpret_cast(buffer) + bytes_read, @@ -82,7 +80,6 @@ std::string DataSocket::Receive(size_t length) { int DataSocket::Send(const void *buffer, size_t size) { int bytes_sent = 0; int data_size = static_cast(size); // signed size - LOG(logDEBUG1) << "Sending " << data_size << " bytes on socket "; while (bytes_sent < (data_size)) { auto this_send = ::write(getSocketId(), buffer, size); if (this_send <= 0) @@ -149,8 +146,6 @@ void DataSocket::close() { } else { throw std::runtime_error("Socket ERROR: close called on bad socket\n"); } - - LOG(logDEBUG1) << "Closed socket with id: " << getSocketId(); } void DataSocket::shutDownSocket() { diff --git a/slsSupportLib/src/ServerSocket.cpp b/slsSupportLib/src/ServerSocket.cpp index d046ae498..d0a6f4d36 100644 --- a/slsSupportLib/src/ServerSocket.cpp +++ b/slsSupportLib/src/ServerSocket.cpp @@ -44,7 +44,6 @@ ServerSocket::ServerSocket(int port) } ServerInterface ServerSocket::accept() { - LOG(logDEBUG1) << "In accept function, waiting for client to connect..."; lastClient = thisClient; // update from previous connection struct sockaddr_in clientAddr; socklen_t addr_size = sizeof clientAddr; @@ -57,7 +56,7 @@ ServerInterface ServerSocket::accept() { char tc[INET_ADDRSTRLEN]{}; inet_ntop(AF_INET, &(clientAddr.sin_addr), tc, INET_ADDRSTRLEN); thisClient = IpAddr{tc}; - LOG(logDEBUG1) << "Accepted connection from: " << tc << ":" + LOG(logDEBUG3) << "Accepted connection from: " << tc << ":" << ntohs(clientAddr.sin_port); // Set socket buffer size return ServerInterface(newSocket);