comparison OrthancFramework/Sources/DicomNetworking/DicomServer.cpp @ 4284:756126cd2219

moving all logs from DicomNetworking folder into the "dicom" category
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 04 Nov 2020 15:01:47 +0100
parents bf7b9edf6b81
children f5d44e30b429
comparison
equal deleted inserted replaced
4283:6b58ceed959e 4284:756126cd2219
46 }; 46 };
47 47
48 48
49 void DicomServer::ServerThread(DicomServer* server) 49 void DicomServer::ServerThread(DicomServer* server)
50 { 50 {
51 LOG(INFO) << "DICOM server started"; 51 CLOG(INFO, DICOM) << "DICOM server started";
52 52
53 while (server->continue_) 53 while (server->continue_)
54 { 54 {
55 /* receive an association and acknowledge or reject it. If the association was */ 55 /* receive an association and acknowledge or reject it. If the association was */
56 /* acknowledged, offer corresponding services and invoke one or more if required. */ 56 /* acknowledged, offer corresponding services and invoke one or more if required. */
63 server->pimpl_->workers_->Add(dispatcher.release()); 63 server->pimpl_->workers_->Add(dispatcher.release());
64 } 64 }
65 } 65 }
66 catch (OrthancException& e) 66 catch (OrthancException& e)
67 { 67 {
68 LOG(ERROR) << "Exception in the DICOM server thread: " << e.What(); 68 CLOG(ERROR, DICOM) << "Exception in the DICOM server thread: " << e.What();
69 } 69 }
70 } 70 }
71 71
72 LOG(INFO) << "DICOM server stopping"; 72 CLOG(INFO, DICOM) << "DICOM server stopping";
73 } 73 }
74 74
75 75
76 DicomServer::DicomServer() : 76 DicomServer::DicomServer() :
77 pimpl_(new PImpl), 77 pimpl_(new PImpl),
93 93
94 DicomServer::~DicomServer() 94 DicomServer::~DicomServer()
95 { 95 {
96 if (continue_) 96 if (continue_)
97 { 97 {
98 LOG(ERROR) << "INTERNAL ERROR: DicomServer::Stop() should be invoked manually to avoid mess in the destruction order!"; 98 CLOG(ERROR, DICOM) << "INTERNAL ERROR: DicomServer::Stop() should be invoked manually to avoid mess in the destruction order!";
99 Stop(); 99 Stop();
100 } 100 }
101 } 101 }
102 102
103 void DicomServer::SetPortNumber(uint16_t port) 103 void DicomServer::SetPortNumber(uint16_t port)
111 return port_; 111 return port_;
112 } 112 }
113 113
114 void DicomServer::SetAssociationTimeout(uint32_t seconds) 114 void DicomServer::SetAssociationTimeout(uint32_t seconds)
115 { 115 {
116 LOG(INFO) << "Setting timeout for DICOM connections if Orthanc acts as SCP (server): " 116 CLOG(INFO, DICOM) << "Setting timeout for DICOM connections if Orthanc acts as SCP (server): "
117 << seconds << " seconds (0 = no timeout)"; 117 << seconds << " seconds (0 = no timeout)";
118 118
119 Stop(); 119 Stop();
120 associationTimeout_ = seconds; 120 associationTimeout_ = seconds;
121 } 121 }
122 122
154 if (!(aet[i] == '-' || 154 if (!(aet[i] == '-' ||
155 aet[i] == '_' || 155 aet[i] == '_' ||
156 isdigit(aet[i]) || 156 isdigit(aet[i]) ||
157 (aet[i] >= 'A' && aet[i] <= 'Z'))) 157 (aet[i] >= 'A' && aet[i] <= 'Z')))
158 { 158 {
159 LOG(WARNING) << "For best interoperability, only upper case, alphanumeric characters should be present in AET: \"" << aet << "\""; 159 CLOG(WARNING, DICOM) << "For best interoperability, only upper case, alphanumeric characters should be present in AET: \"" << aet << "\"";
160 break; 160 break;
161 } 161 }
162 } 162 }
163 163
164 Stop(); 164 Stop();
390 /* drop the network, i.e. free memory of T_ASC_Network* structure. This call */ 390 /* drop the network, i.e. free memory of T_ASC_Network* structure. This call */
391 /* is the counterpart of ASC_initializeNetwork(...) which was called above. */ 391 /* is the counterpart of ASC_initializeNetwork(...) which was called above. */
392 OFCondition cond = ASC_dropNetwork(&pimpl_->network_); 392 OFCondition cond = ASC_dropNetwork(&pimpl_->network_);
393 if (cond.bad()) 393 if (cond.bad())
394 { 394 {
395 LOG(ERROR) << "Error while dropping the network: " << cond.text(); 395 CLOG(ERROR, DICOM) << "Error while dropping the network: " << cond.text();
396 } 396 }
397 } 397 }
398 } 398 }
399 399
400 400