From a06f29f473aa78da8a7dabe3fb0319805012ec9e Mon Sep 17 00:00:00 2001 From: Dhanya Maliakal Date: Fri, 1 Dec 2017 11:23:17 +0100 Subject: [PATCH 1/2] minor cosmetics --- slsReceiverSoftware/src/DataProcessor.cpp | 2 +- slsReceiverSoftware/src/DataStreamer.cpp | 2 +- slsReceiverSoftware/src/Fifo.cpp | 14 +++---- slsReceiverSoftware/src/Listener.cpp | 2 +- slsReceiverSoftware/src/ThreadObject.cpp | 10 ++--- .../src/UDPStandardImplementation.cpp | 38 +++++++++---------- 6 files changed, 34 insertions(+), 34 deletions(-) diff --git a/slsReceiverSoftware/src/DataProcessor.cpp b/slsReceiverSoftware/src/DataProcessor.cpp index 74c382f9d..286d60e43 100644 --- a/slsReceiverSoftware/src/DataProcessor.cpp +++ b/slsReceiverSoftware/src/DataProcessor.cpp @@ -67,7 +67,7 @@ DataProcessor::DataProcessor(Fifo*& f, fileFormat* ftype, bool fwenable, bool* d } NumberofDataProcessors++; - FILE_LOG (logDEBUG) << "Number of DataProcessors: " << NumberofDataProcessors; + FILE_LOG(logDEBUG) << "Number of DataProcessors: " << NumberofDataProcessors; memset((void*)&timerBegin, 0, sizeof(timespec)); } diff --git a/slsReceiverSoftware/src/DataStreamer.cpp b/slsReceiverSoftware/src/DataStreamer.cpp index 8335cd52d..d2964af82 100644 --- a/slsReceiverSoftware/src/DataStreamer.cpp +++ b/slsReceiverSoftware/src/DataStreamer.cpp @@ -47,7 +47,7 @@ DataStreamer::DataStreamer(Fifo*& f, uint32_t* dr, int* sEnable, uint64_t* fi) : } NumberofDataStreamers++; - FILE_LOG (logDEBUG) << "Number of DataStreamers: " << NumberofDataStreamers; + FILE_LOG(logDEBUG) << "Number of DataStreamers: " << NumberofDataStreamers; strcpy(fileNametoStream, ""); } diff --git a/slsReceiverSoftware/src/Fifo.cpp b/slsReceiverSoftware/src/Fifo.cpp index f545235b6..2c071356a 100644 --- a/slsReceiverSoftware/src/Fifo.cpp +++ b/slsReceiverSoftware/src/Fifo.cpp @@ -23,7 +23,7 @@ Fifo::Fifo(uint32_t fifoItemSize, uint32_t depth, bool &success): fifoDepth(depth), status_fifoBound(0), status_fifoFree(depth){ - FILE_LOG (logDEBUG) << __AT__ << " called"; + FILE_LOG(logDEBUG) << __AT__ << " called"; NumberofFifoClassObjects++; if(CreateFifos(fifoItemSize) == FAIL) success = false; @@ -31,7 +31,7 @@ Fifo::Fifo(uint32_t fifoItemSize, uint32_t depth, bool &success): Fifo::~Fifo() { - FILE_LOG (logDEBUG) << __AT__ << " called"; + FILE_LOG(logDEBUG) << __AT__ << " called"; //cprintf(BLUE,"Fifo Object %d: Goodbye\n", index); DestroyFifos(); NumberofFifoClassObjects--; @@ -40,7 +40,7 @@ Fifo::~Fifo() { int Fifo::CreateFifos(uint32_t fifoItemSize) { - FILE_LOG (logDEBUG) << __AT__ << " called"; + FILE_LOG(logDEBUG) << __AT__ << " called"; //destroy if not already DestroyFifos(); @@ -53,11 +53,11 @@ int Fifo::CreateFifos(uint32_t fifoItemSize) { memory = (char*) calloc (fifoItemSize * fifoDepth, sizeof(char)); memset(memory,0,fifoItemSize * fifoDepth* sizeof(char)); if (memory == NULL){ - FILE_LOG (logERROR) << "Could not allocate memory for fifos"; + FILE_LOG(logERROR) << "Could not allocate memory for fifos"; memory = 0; return FAIL; } - FILE_LOG (logDEBUG) << "Memory Allocated " << index << ": " << (fifoItemSize * fifoDepth) << " bytes"; + FILE_LOG(logDEBUG) << "Memory Allocated " << index << ": " << (fifoItemSize * fifoDepth) << " bytes"; { //push free addresses into fifoFree fifo char* buffer = memory; @@ -71,13 +71,13 @@ int Fifo::CreateFifos(uint32_t fifoItemSize) { } } - FILE_LOG (logDEBUG) << "Fifo Reconstructed Depth " << index << ": " << fifoDepth; + FILE_LOG(logDEBUG) << "Fifo Reconstructed Depth " << index << ": " << fifoDepth; return OK; } void Fifo::DestroyFifos(){ - FILE_LOG (logDEBUG) << __AT__ << " called"; + FILE_LOG(logDEBUG) << __AT__ << " called"; if(memory) { diff --git a/slsReceiverSoftware/src/Listener.cpp b/slsReceiverSoftware/src/Listener.cpp index 1b147795a..533ad0a11 100644 --- a/slsReceiverSoftware/src/Listener.cpp +++ b/slsReceiverSoftware/src/Listener.cpp @@ -59,7 +59,7 @@ Listener::Listener(detectorType dtype, Fifo*& f, runStatus* s, uint32_t* portno, pthread_mutex_unlock(&Mutex); } NumberofListeners++; - FILE_LOG (logDEBUG) << "Number of Listeners: " << NumberofListeners; + FILE_LOG(logDEBUG) << "Number of Listeners: " << NumberofListeners; switch(myDetectorType){ case JUNGFRAU: diff --git a/slsReceiverSoftware/src/ThreadObject.cpp b/slsReceiverSoftware/src/ThreadObject.cpp index f17bed83a..58e448d8c 100644 --- a/slsReceiverSoftware/src/ThreadObject.cpp +++ b/slsReceiverSoftware/src/ThreadObject.cpp @@ -29,7 +29,7 @@ ThreadObject::~ThreadObject() { void ThreadObject::PrintMembers() { - FILE_LOG (logDEBUG) << "Index : " << index + FILE_LOG(logDEBUG) << "Index : " << index << "\nalive: " << alive << "\nkillThread: " << killThread << "\npthread: " << thread; @@ -44,25 +44,25 @@ void ThreadObject::DestroyThread() { sem_destroy(&semaphore); killThread = false; alive = false; - FILE_LOG (logDEBUG) << GetType() << " thread with index " << index << " destroyed successfully."; + FILE_LOG(logDEBUG) << GetType() << " thread with index " << index << " destroyed successfully."; } } int ThreadObject::CreateThread() { if(alive){ - FILE_LOG (logERROR) << "Cannot create thread " << index << ". Already alive"; + FILE_LOG(logERROR) << "Cannot create thread " << index << ". Already alive"; return FAIL; } sem_init(&semaphore,1,0); killThread = false; if(pthread_create(&thread, NULL,StartThread, (void*) this)){ - FILE_LOG (logERROR) << "Could not create " << GetType() << " thread with index " << index; + FILE_LOG(logERROR) << "Could not create " << GetType() << " thread with index " << index; return FAIL; } alive = true; - FILE_LOG (logDEBUG) << GetType() << " thread " << index << " created successfully."; + FILE_LOG(logDEBUG) << GetType() << " thread " << index << " created successfully."; return OK; } diff --git a/slsReceiverSoftware/src/UDPStandardImplementation.cpp b/slsReceiverSoftware/src/UDPStandardImplementation.cpp index a09bca237..851b524c8 100644 --- a/slsReceiverSoftware/src/UDPStandardImplementation.cpp +++ b/slsReceiverSoftware/src/UDPStandardImplementation.cpp @@ -171,7 +171,7 @@ int UDPStandardImplementation::setShortFrameEnable(const int i) { for (vector::const_iterator it = dataStreamer.begin(); it != dataStreamer.end(); ++it) (*it)->SetGeneralData(generalData); } - FILE_LOG (logINFO) << "Short Frame Enable: " << shortFrameEnable; + FILE_LOG(logINFO) << "Short Frame Enable: " << shortFrameEnable; return OK; } @@ -191,7 +191,7 @@ int UDPStandardImplementation::setFrameToGuiFrequency(const uint32_t freq) { break; }*/ } - FILE_LOG (logINFO) << "Frame to Gui Frequency: " << frameToGuiFrequency; + FILE_LOG(logINFO) << "Frame to Gui Frequency: " << frameToGuiFrequency; return OK; } @@ -230,7 +230,7 @@ int UDPStandardImplementation::setDataStreamEnable(const bool enable) { SetThreadPriorities(); } } - FILE_LOG (logINFO) << "Data Send to Gui: " << dataStreamEnable; + FILE_LOG(logINFO) << "Data Send to Gui: " << dataStreamEnable; return OK; } @@ -246,7 +246,7 @@ int UDPStandardImplementation::setDynamicRange(const uint32_t i) { if (SetupFifoStructure() == FAIL) return FAIL; } - FILE_LOG (logINFO) << "Dynamic Range: " << dynamicRange; + FILE_LOG(logINFO) << "Dynamic Range: " << dynamicRange; return OK; } @@ -261,7 +261,7 @@ int UDPStandardImplementation::setTenGigaEnable(const bool b) { if (SetupFifoStructure() == FAIL) return FAIL; } - FILE_LOG (logINFO) << "Ten Giga: " << stringEnable(tengigaEnable); + FILE_LOG(logINFO) << "Ten Giga: " << stringEnable(tengigaEnable); return OK; } @@ -274,7 +274,7 @@ int UDPStandardImplementation::setFifoDepth(const uint32_t i) { if (SetupFifoStructure() == FAIL) return FAIL; } - FILE_LOG (logINFO) << "Fifo Depth: " << i; + FILE_LOG(logINFO) << "Fifo Depth: " << i; return OK; } @@ -291,7 +291,7 @@ void UDPStandardImplementation::setSilentMode(const uint32_t i){ int UDPStandardImplementation::setDetectorType(const detectorType d) { - FILE_LOG (logDEBUG) << "Setting receiver type"; + FILE_LOG(logDEBUG) << "Setting receiver type"; DeleteMembers(); InitializeMembers(); myDetectorType = d; @@ -302,10 +302,10 @@ int UDPStandardImplementation::setDetectorType(const detectorType d) { case EIGER: case JUNGFRAUCTB: case JUNGFRAU: - FILE_LOG (logINFO) << " ***** " << getDetectorType(d) << " Receiver *****"; + FILE_LOG(logINFO) << " ***** " << getDetectorType(d) << " Receiver *****"; break; default: - FILE_LOG (logERROR) << "This is an unknown receiver type " << (int)d; + FILE_LOG(logERROR) << "This is an unknown receiver type " << (int)d; return FAIL; } @@ -329,7 +329,7 @@ int UDPStandardImplementation::setDetectorType(const detectorType d) { //create fifo structure numberofJobs = -1; if (SetupFifoStructure() == FAIL) { - FILE_LOG (logERROR) << "Error: Could not allocate memory for fifo structure"; + FILE_LOG(logERROR) << "Error: Could not allocate memory for fifo structure"; return FAIL; } @@ -340,7 +340,7 @@ int UDPStandardImplementation::setDetectorType(const detectorType d) { fileWriteEnable, &dataStreamEnable, &frameToGuiFrequency, &frameToGuiTimerinMS, rawDataReadyCallBack,pRawDataReady)); if (Listener::GetErrorMask() || DataProcessor::GetErrorMask()) { - FILE_LOG (logERROR) << "Error: Could not creates listener/dataprocessor threads (index:" << i << ")"; + FILE_LOG(logERROR) << "Error: Could not creates listener/dataprocessor threads (index:" << i << ")"; for (vector::const_iterator it = listener.begin(); it != listener.end(); ++it) delete(*it); listener.clear(); @@ -359,7 +359,7 @@ int UDPStandardImplementation::setDetectorType(const detectorType d) { SetThreadPriorities(); - FILE_LOG (logDEBUG) << " Detector type set to " << getDetectorType(d); + FILE_LOG(logDEBUG) << " Detector type set to " << getDetectorType(d); return OK; } @@ -387,7 +387,7 @@ void UDPStandardImplementation::resetAcquisitionCount() { for (vector::const_iterator it = dataStreamer.begin(); it != dataStreamer.end(); ++it) (*it)->ResetParametersforNewAcquisition(); - FILE_LOG (logINFO) << "Acquisition Count has been reset"; + FILE_LOG(logINFO) << "Acquisition Count has been reset"; } @@ -597,19 +597,19 @@ void UDPStandardImplementation::SetLocalNetworkParameters() { //to increase Socket Receiver Buffer size sprintf(command,"echo $((%d)) > /proc/sys/net/core/rmem_max",RECEIVE_SOCKET_BUFFER_SIZE); if (system(command)) { - FILE_LOG (logWARNING) << "No root privileges to change Socket Receiver Buffer size (net.core.rmem_max)"; + FILE_LOG(logWARNING) << "No root privileges to change Socket Receiver Buffer size (net.core.rmem_max)"; return; } - FILE_LOG (logINFO) << "Socket Receiver Buffer size (/proc/sys/net/core/rmem_max) modified to " << RECEIVE_SOCKET_BUFFER_SIZE ; + FILE_LOG(logINFO) << "Socket Receiver Buffer size (/proc/sys/net/core/rmem_max) modified to " << RECEIVE_SOCKET_BUFFER_SIZE ; // to increase Max length of input packet queue sprintf(command,"echo %d > /proc/sys/net/core/netdev_max_backlog",MAX_SOCKET_INPUT_PACKET_QUEUE); if (system(command)) { - FILE_LOG (logWARNING) << "No root privileges to change Max length of input packet queue (net.core.rmem_max)"; + FILE_LOG(logWARNING) << "No root privileges to change Max length of input packet queue (net.core.rmem_max)"; return; } - FILE_LOG (logINFO) << "Max length of input packet queue (/proc/sys/net/core/netdev_max_backlog) modified to " << MAX_SOCKET_INPUT_PACKET_QUEUE ; + FILE_LOG(logINFO) << "Max length of input packet queue (/proc/sys/net/core/netdev_max_backlog) modified to " << MAX_SOCKET_INPUT_PACKET_QUEUE ; } @@ -656,8 +656,8 @@ int UDPStandardImplementation::SetupFifoStructure() { if(dataStreamer.size())dataStreamer[i]->SetFifo(fifo[i]); } - FILE_LOG (logINFO) << "Memory Allocated Per Fifo: " << ( ((generalData->imageSize) * numberofJobs + (generalData->fifoBufferHeaderSize)) * fifoDepth) << " bytes" ; - FILE_LOG (logINFO) << " Fifo structure(s) reconstructed: " << numThreads; + FILE_LOG(logINFO) << "Memory Allocated Per Fifo: " << ( ((generalData->imageSize) * numberofJobs + (generalData->fifoBufferHeaderSize)) * fifoDepth) << " bytes" ; + FILE_LOG(logINFO) << " Fifo structure(s) reconstructed: " << numThreads; return OK; } From d1e3d50a877d16ca5f648d0339e017ad2e1879c0 Mon Sep 17 00:00:00 2001 From: Dhanya Maliakal Date: Fri, 1 Dec 2017 12:43:14 +0100 Subject: [PATCH 2/2] cosmetic print outs --- .../src/UDPBaseImplementation.cpp | 18 ++-- slsReceiverSoftware/src/UDPInterface.cpp | 2 +- .../src/UDPStandardImplementation.cpp | 4 +- slsReceiverSoftware/src/slsReceiver.cpp | 7 +- .../src/slsReceiverTCPIPInterface.cpp | 88 +++++++++---------- 5 files changed, 57 insertions(+), 62 deletions(-) diff --git a/slsReceiverSoftware/src/UDPBaseImplementation.cpp b/slsReceiverSoftware/src/UDPBaseImplementation.cpp index d93b824cb..f48232afe 100644 --- a/slsReceiverSoftware/src/UDPBaseImplementation.cpp +++ b/slsReceiverSoftware/src/UDPBaseImplementation.cpp @@ -222,7 +222,7 @@ uint32_t UDPBaseImplementation::getStreamingPort() const{FILE_LOG(logDEBUG) << _ /**initial parameters***/ void UDPBaseImplementation::configure(map config_map){ - FILE_LOG(logWARNING) << __AT__ << " doing nothing..."; + FILE_LOG(logERROR) << __AT__ << " doing nothing..."; FILE_LOG(logERROR) << __AT__ << " must be overridden by child classes"; } @@ -288,7 +288,7 @@ void UDPBaseImplementation::setFilePath(const char c[]){ if(stat(c,&st) == 0) strcpy(filePath,c); else - FILE_LOG(logWARNING) << "FilePath does not exist: " << filePath; + FILE_LOG(logERROR) << "FilePath does not exist: " << filePath; } FILE_LOG(logINFO) << "Info: File path: " << filePath; } @@ -518,35 +518,35 @@ void UDPBaseImplementation::resetAcquisitionCount(){ } int UDPBaseImplementation::startReceiver(char *c){ - FILE_LOG(logWARNING) << __AT__ << " doing nothing..."; + FILE_LOG(logERROR) << __AT__ << " doing nothing..."; FILE_LOG(logERROR) << __AT__ << " must be overridden by child classes"; return OK; } void UDPBaseImplementation::stopReceiver(){ - FILE_LOG(logWARNING) << __AT__ << " doing nothing..."; + FILE_LOG(logERROR) << __AT__ << " doing nothing..."; FILE_LOG(logERROR) << __AT__ << " must be overridden by child classes"; } void UDPBaseImplementation::startReadout(){ - FILE_LOG(logWARNING) << __AT__ << " doing nothing..."; + FILE_LOG(logERROR) << __AT__ << " doing nothing..."; FILE_LOG(logERROR) << __AT__ << " must be overridden by child classes"; } void UDPBaseImplementation::shutDownUDPSockets(){ - FILE_LOG(logWARNING) << __AT__ << " doing nothing..."; + FILE_LOG(logERROR) << __AT__ << " doing nothing..."; FILE_LOG(logERROR) << __AT__ << " must be overridden by child classes"; } void UDPBaseImplementation::readFrame(int ithread, char* c,char** raw, int64_t &startAcquisitionIndex, int64_t &startFrameIndex){ - FILE_LOG(logWARNING) << __AT__ << " doing nothing..."; + FILE_LOG(logERROR) << __AT__ << " doing nothing..."; FILE_LOG(logERROR) << __AT__ << " must be overridden by child classes"; } //FIXME: needed, isnt stopReceiver enough? void UDPBaseImplementation::abort(){ - FILE_LOG(logWARNING) << __AT__ << " doing nothing..."; + FILE_LOG(logERROR) << __AT__ << " doing nothing..."; FILE_LOG(logERROR) << __AT__ << " must be overridden by child classes"; } @@ -570,7 +570,7 @@ void UDPBaseImplementation::setStreamingPort(const uint32_t i) { int UDPBaseImplementation::restreamStop() { - FILE_LOG(logWARNING) << __AT__ << " doing nothing..."; + FILE_LOG(logERROR) << __AT__ << " doing nothing..."; FILE_LOG(logERROR) << __AT__ << " must be overridden by child classes"; return OK; } diff --git a/slsReceiverSoftware/src/UDPInterface.cpp b/slsReceiverSoftware/src/UDPInterface.cpp index a6bd2cfac..9f22429e2 100644 --- a/slsReceiverSoftware/src/UDPInterface.cpp +++ b/slsReceiverSoftware/src/UDPInterface.cpp @@ -33,7 +33,7 @@ UDPInterface * UDPInterface::create(string receiver_type){ } #endif else{ - FILE_LOG(logWARNING) << "[ERROR] UDP interface not supported, using standard implementation"; + FILE_LOG(logERROR) << "UDP interface not supported, using base implementation"; return new UDPBaseImplementation(); } } diff --git a/slsReceiverSoftware/src/UDPStandardImplementation.cpp b/slsReceiverSoftware/src/UDPStandardImplementation.cpp index 851b524c8..35a454cba 100644 --- a/slsReceiverSoftware/src/UDPStandardImplementation.cpp +++ b/slsReceiverSoftware/src/UDPStandardImplementation.cpp @@ -329,7 +329,7 @@ int UDPStandardImplementation::setDetectorType(const detectorType d) { //create fifo structure numberofJobs = -1; if (SetupFifoStructure() == FAIL) { - FILE_LOG(logERROR) << "Error: Could not allocate memory for fifo structure"; + FILE_LOG(logERROR) << "Could not allocate memory for fifo structure"; return FAIL; } @@ -340,7 +340,7 @@ int UDPStandardImplementation::setDetectorType(const detectorType d) { fileWriteEnable, &dataStreamEnable, &frameToGuiFrequency, &frameToGuiTimerinMS, rawDataReadyCallBack,pRawDataReady)); if (Listener::GetErrorMask() || DataProcessor::GetErrorMask()) { - FILE_LOG(logERROR) << "Error: Could not creates listener/dataprocessor threads (index:" << i << ")"; + FILE_LOG(logERROR) << "Could not create listener/dataprocessor threads (index:" << i << ")"; for (vector::const_iterator it = listener.begin(); it != listener.end(); ++it) delete(*it); listener.clear(); diff --git a/slsReceiverSoftware/src/slsReceiver.cpp b/slsReceiverSoftware/src/slsReceiver.cpp index 3089a8a1a..38e325968 100644 --- a/slsReceiverSoftware/src/slsReceiver.cpp +++ b/slsReceiverSoftware/src/slsReceiver.cpp @@ -113,16 +113,11 @@ slsReceiver::slsReceiver(int argc, char *argv[], int &success) { //VERBOSE_PRINT("Read configuration file of " + iline + " lines"); } catch(...){ - FILE_LOG(logERROR) << "Error opening configuration file " << fname ; + FILE_LOG(logERROR) << "Coult not open configuration file " << fname ; success = FAIL; } } - - if(success != OK){ - FILE_LOG(logERROR) << "Failed: see output above for more information " ; - } - if (success==OK){ FILE_LOG(logINFO) << "SLS Receiver starting " << udp_interface_type << " on port " << tcpip_port_no << endl; #ifdef REST diff --git a/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp b/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp index 48e64346c..95048f9c0 100644 --- a/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp +++ b/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp @@ -370,7 +370,7 @@ int slsReceiverTCPIPInterface::decode_function(){ ret=(this->*flist[fnum])(); } if (ret == FAIL) { - FILE_LOG(logERROR) << "Error executing the function = " << fnum << " (" << getFunctionName((enum recFuncs)fnum) << ")"; + FILE_LOG(logERROR) << "Failed to execute function = " << fnum << " (" << getFunctionName((enum recFuncs)fnum) << ")"; } return ret; } @@ -378,7 +378,7 @@ int slsReceiverTCPIPInterface::decode_function(){ int slsReceiverTCPIPInterface::printSocketReadError() { - FILE_LOG(logERROR) << "Error reading from socket. Possible socket crash"; + FILE_LOG(logERROR) << "Reading from socket failed. Possible socket crash"; return FAIL; } @@ -386,27 +386,27 @@ int slsReceiverTCPIPInterface::printSocketReadError() { void slsReceiverTCPIPInterface::invalidReceiverObject() { ret=FAIL; strcpy(mess,"Receiver not set up. Please use rx_hostname first.\n"); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } void slsReceiverTCPIPInterface::receiverlocked() { ret = FAIL; sprintf(mess,"Receiver locked by %s\n",mySock->lastClientIP); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } void slsReceiverTCPIPInterface::receiverNotIdle() { ret = FAIL; sprintf(mess,"Can not execute %s when receiver is not idle\n", getFunctionName((enum recFuncs)fnum)); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } void slsReceiverTCPIPInterface::functionNotImplemented() { ret = FAIL; sprintf(mess, "Function (%s) is not implemented for this detector\n",getFunctionName((enum recFuncs)fnum)); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } @@ -458,7 +458,7 @@ int slsReceiverTCPIPInterface::exec_command() { } else { ret = FAIL; sprintf(mess,"Executing Command failed\n"); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } } @@ -553,13 +553,13 @@ int slsReceiverTCPIPInterface::set_port() { if (mySock->differentClients && lockStatus) { ret=FAIL; sprintf(mess,"Detector locked by %s\n",mySock->lastClientIP); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } else { if (p_number<1024) { ret = FAIL; sprintf(mess,"Port Number (%d) too low\n", p_number); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } FILE_LOG(logINFO) << "set port to " << p_number <lastClientIP); @@ -570,11 +570,11 @@ int slsReceiverTCPIPInterface::set_port() { if (sd < 0) { ret = FAIL; sprintf(mess,"Could not bind port %d\n", p_number); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; if (sd == -10) { ret = FAIL; sprintf(mess,"Port %d already set\n", p_number); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } } else @@ -757,7 +757,7 @@ int slsReceiverTCPIPInterface::set_detector_type(){ default: ret = FAIL; sprintf(mess,"Unknown detector type: %d\n", dr); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; break; } if(ret == OK) { @@ -931,7 +931,7 @@ int slsReceiverTCPIPInterface::setup_udp(){ if (temp == "none"){ ret = FAIL; strcpy(mess, "Failed to get ethernet interface or IP\n"); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } else { char eth[MAX_STR_LENGTH]; @@ -941,7 +941,7 @@ int slsReceiverTCPIPInterface::setup_udp(){ strcpy(eth,""); ret = FAIL; strcpy(mess, "Failed to get ethernet interface\n"); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } receiverBase->setEthernetInterface(eth); @@ -952,7 +952,7 @@ int slsReceiverTCPIPInterface::setup_udp(){ if ((temp=="00:00:00:00:00:00") || (ret == FAIL)){ ret = FAIL; strcpy(mess,"failed to get mac adddress to listen to\n"); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } else { strcpy(retval,temp.c_str()); @@ -1016,7 +1016,7 @@ int slsReceiverTCPIPInterface::set_timer() { default: ret = FAIL; sprintf(mess,"This timer mode (%lld) does not exist for receiver\n", (long long int)index[0]); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } } } @@ -1038,14 +1038,14 @@ int slsReceiverTCPIPInterface::set_timer() { default: ret = FAIL; sprintf(mess,"This timer mode (%lld) does not exist for receiver\n", (long long int)index[0]); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } // check if (ret == OK && index[1] >= 0 && retval != index[1]) { ret = FAIL; strcpy(mess,"Could not set timer\n"); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } } #endif @@ -1097,7 +1097,7 @@ int slsReceiverTCPIPInterface::set_dynamic_range() { if (!exists) { ret = FAIL; sprintf(mess,"This dynamic range %d does not exist for this detector\n",dr); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } #ifdef SLS_RECEIVER_UDP_FUNCTIONS @@ -1115,7 +1115,7 @@ int slsReceiverTCPIPInterface::set_dynamic_range() { ret = receiverBase->setDynamicRange(dr); if(ret == FAIL) { strcpy(mess, "Could not allocate memory for fifo or could not start listening/writing threads\n"); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } } } @@ -1124,7 +1124,7 @@ int slsReceiverTCPIPInterface::set_dynamic_range() { if(dr > 0 && retval != dr) { ret = FAIL; strcpy(mess, "Could not set dynamic range\n"); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } } } @@ -1173,7 +1173,7 @@ int slsReceiverTCPIPInterface::set_read_frequency(){ ret = receiverBase->setFrameToGuiFrequency(index); if(ret == FAIL) { strcpy(mess, "Could not allocate memory for listening fifo\n"); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } } } @@ -1182,7 +1182,7 @@ int slsReceiverTCPIPInterface::set_read_frequency(){ if(index >= 0 && retval != index){ ret = FAIL; strcpy(mess,"Could not set frame to gui frequency"); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } } #endif @@ -1248,12 +1248,12 @@ int slsReceiverTCPIPInterface::start_receiver(){ if (s != IDLE) { ret=FAIL; sprintf(mess,"Cannot start Receiver as it is in %s state\n",runStatusType(s).c_str()); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } else { ret=receiverBase->startReceiver(mess); if (ret == FAIL) { - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } } } @@ -1296,7 +1296,7 @@ int slsReceiverTCPIPInterface::stop_receiver(){ else { ret = FAIL; sprintf(mess,"Could not stop receiver. It is in %s state\n",runStatusType(s).c_str()); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } } #endif @@ -1340,7 +1340,7 @@ int slsReceiverTCPIPInterface::start_readout(){ else { ret = FAIL; strcpy(mess,"Could not start readout"); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } } #endif @@ -1415,7 +1415,7 @@ int slsReceiverTCPIPInterface::set_file_dir() { if (retval == NULL || (strlen(fPath) && strcasecmp(fPath, retval))) { ret = FAIL; strcpy(mess,"receiver file path does not exist\n"); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } } #endif @@ -1476,7 +1476,7 @@ int slsReceiverTCPIPInterface::set_file_name() { if(retval == NULL) { ret = FAIL; strcpy(mess, "file name is empty\n"); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } } #endif @@ -1534,7 +1534,7 @@ int slsReceiverTCPIPInterface::set_file_index() { if(index >= 0 && retval != index) { ret = FAIL; strcpy(mess, "Could not set file index\n"); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } } #endif @@ -1726,7 +1726,7 @@ int slsReceiverTCPIPInterface::enable_file_write(){ if(enable >= 0 && enable != retval) { ret=FAIL; strcpy(mess,"Could not set file write enable"); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } } #endif @@ -1762,7 +1762,7 @@ int slsReceiverTCPIPInterface::enable_compression() { ret = FAIL; sprintf(mess, "This function (%s) is not implemented yet\n", getFunctionName((enum recFuncs)fnum)); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; // send answer mySock->SendDataOnly(&ret,sizeof(ret)); @@ -1804,7 +1804,7 @@ int slsReceiverTCPIPInterface::enable_overwrite() { if(index >=0 && retval != index) { ret = FAIL; strcpy(mess,"Could not set file over write enable\n"); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } } #endif @@ -1863,7 +1863,7 @@ int slsReceiverTCPIPInterface::enable_tengiga() { if((val >= 0) && (val != retval)) { ret = FAIL; strcpy(mess,"Could not set ten giga enable"); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } } } @@ -1913,7 +1913,7 @@ int slsReceiverTCPIPInterface::set_fifo_depth() { ret = receiverBase->setFifoDepth(value); if (ret == FAIL) { strcpy(mess,"Could not set fifo depth"); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } } } @@ -1922,7 +1922,7 @@ int slsReceiverTCPIPInterface::set_fifo_depth() { if(value >= 0 && retval != value) { ret = FAIL; strcpy(mess, "Could not set fifo depth\n"); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } } #endif @@ -1979,7 +1979,7 @@ int slsReceiverTCPIPInterface::set_activate() { if(enable >= 0 && retval != enable){ ret = FAIL; sprintf(mess,"Could not set activate to %d, returned %d\n",enable,retval); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } } } @@ -2033,7 +2033,7 @@ int slsReceiverTCPIPInterface::set_data_stream_enable(){ if(index >= 0 && retval != index){ ret = FAIL; strcpy(mess,"Could not set data stream enable"); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } } #endif @@ -2086,7 +2086,7 @@ int slsReceiverTCPIPInterface::set_read_receiver_timer(){ if(index >= 0 && retval != index){ ret = FAIL; strcpy(mess,"Could not set datastream timer"); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } } #endif @@ -2143,7 +2143,7 @@ int slsReceiverTCPIPInterface::set_flipped_data(){ if (args[1] > -1 && retval != args[1]) { ret = FAIL; strcpy(mess, "Could not set flipped data\n"); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } } } @@ -2198,7 +2198,7 @@ int slsReceiverTCPIPInterface::set_file_format() { if(f >= 0 && retval != f){ ret = FAIL; sprintf(mess,"Could not set file format to %s, returned %s\n",getFileFormatType(f).c_str(),getFileFormatType(retval).c_str()); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } } #endif @@ -2251,7 +2251,7 @@ int slsReceiverTCPIPInterface::set_detector_posid() { if (arg >= 0 && retval != arg) { ret = FAIL; strcpy(mess,"Could not set detector position id"); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } } #endif @@ -2447,12 +2447,12 @@ int slsReceiverTCPIPInterface::restream_stop(){ else if (receiverBase->getDataStreamEnable() == false) { ret = FAIL; sprintf(mess,"Could not restream stop packet as data Streaming is disabled.\n"); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } else { ret = receiverBase->restreamStop(); if (ret == FAIL) { sprintf(mess,"Could not restream stop packet.\n"); - FILE_LOG(logERROR) << "Warning: " << mess; + FILE_LOG(logERROR) << mess; } } #endif