# HG changeset patch # User Sebastien Jodogne # Date 1604498507 -3600 # Node ID 756126cd22193c0310a39bd8ecb42aeac6b91d19 # Parent 6b58ceed959e1b9f84e17a8bf83164cf1d9744bd moving all logs from DicomNetworking folder into the "dicom" category diff -r 6b58ceed959e -r 756126cd2219 OrthancFramework/Sources/DicomNetworking/DicomAssociation.cpp --- a/OrthancFramework/Sources/DicomNetworking/DicomAssociation.cpp Wed Nov 04 14:48:52 2020 +0100 +++ b/OrthancFramework/Sources/DicomNetworking/DicomAssociation.cpp Wed Nov 04 15:01:47 2020 +0100 @@ -159,10 +159,10 @@ { if (found->second.find(syntax) != found->second.end()) { - LOG(WARNING) << "The same transfer syntax (" - << GetTransferSyntaxUid(syntax) - << ") was accepted twice for the same abstract syntax UID (" - << abstractSyntax << ")"; + CLOG(WARNING, DICOM) << "The same transfer syntax (" + << GetTransferSyntaxUid(syntax) + << ") was accepted twice for the same abstract syntax UID (" + << abstractSyntax << ")"; } else { @@ -181,7 +181,7 @@ catch (OrthancException& e) { // Don't throw exception in destructors - LOG(ERROR) << "Error while destroying a DICOM association: " << e.What(); + CLOG(ERROR, DICOM) << "Error while destroying a DICOM association: " << e.What(); } } @@ -257,12 +257,12 @@ "No presentation context was proposed"); } - LOG(INFO) << "Opening a DICOM SCU connection from AET \"" - << parameters.GetLocalApplicationEntityTitle() - << "\" to AET \"" << parameters.GetRemoteModality().GetApplicationEntityTitle() - << "\" on host " << parameters.GetRemoteModality().GetHost() - << ":" << parameters.GetRemoteModality().GetPortNumber() - << " (manufacturer: " << EnumerationToString(parameters.GetRemoteModality().GetManufacturer()) << ")"; + CLOG(INFO, DICOM) << "Opening a DICOM SCU connection from AET \"" + << parameters.GetLocalApplicationEntityTitle() + << "\" to AET \"" << parameters.GetRemoteModality().GetApplicationEntityTitle() + << "\" on host " << parameters.GetRemoteModality().GetHost() + << ":" << parameters.GetRemoteModality().GetPortNumber() + << " (manufacturer: " << EnumerationToString(parameters.GetRemoteModality().GetManufacturer()) << ")"; CheckConnecting(parameters, ASC_initializeNetwork(NET_REQUESTOR, 0, /*opt_acse_timeout*/ acseTimeout, &net_)); CheckConnecting(parameters, ASC_createAssociationParameters(¶ms_, /*opt_maxReceivePDULength*/ ASC_DEFAULTMAXPDU)); @@ -354,9 +354,9 @@ } else { - LOG(WARNING) << "Unknown transfer syntax received from AET \"" - << parameters.GetRemoteModality().GetApplicationEntityTitle() - << "\": " << pc->acceptedTransferSyntax; + CLOG(WARNING, DICOM) << "Unknown transfer syntax received from AET \"" + << parameters.GetRemoteModality().GetApplicationEntityTitle() + << "\": " << pc->acceptedTransferSyntax; } } @@ -619,11 +619,11 @@ * Send the "EVENT_REPORT_RQ" request **/ - LOG(INFO) << "Reporting modality \"" - << parameters.GetRemoteModality().GetApplicationEntityTitle() - << "\" about storage commitment transaction: " << transactionUid - << " (" << successSopClassUids.size() << " successes, " - << failedSopClassUids.size() << " failures)"; + CLOG(INFO, DICOM) << "Reporting modality \"" + << parameters.GetRemoteModality().GetApplicationEntityTitle() + << "\" about storage commitment transaction: " << transactionUid + << " (" << successSopClassUids.size() << " successes, " + << failedSopClassUids.size() << " failures)"; const DIC_US messageId = association.GetDcmtkAssociation().nextMsgID++; { @@ -795,10 +795,10 @@ * Send the "N_ACTION_RQ" request **/ - LOG(INFO) << "Request to modality \"" - << parameters.GetRemoteModality().GetApplicationEntityTitle() - << "\" about storage commitment for " << sopClassUids.size() - << " instances, with transaction UID: " << transactionUid; + CLOG(INFO, DICOM) << "Request to modality \"" + << parameters.GetRemoteModality().GetApplicationEntityTitle() + << "\" about storage commitment for " << sopClassUids.size() + << " instances, with transaction UID: " << transactionUid; const DIC_US messageId = association.GetDcmtkAssociation().nextMsgID++; { diff -r 6b58ceed959e -r 756126cd2219 OrthancFramework/Sources/DicomNetworking/DicomAssociationParameters.cpp --- a/OrthancFramework/Sources/DicomNetworking/DicomAssociationParameters.cpp Wed Nov 04 14:48:52 2020 +0100 +++ b/OrthancFramework/Sources/DicomNetworking/DicomAssociationParameters.cpp Wed Nov 04 15:01:47 2020 +0100 @@ -138,8 +138,8 @@ void DicomAssociationParameters::SetDefaultTimeout(uint32_t seconds) { - LOG(INFO) << "Default timeout for DICOM connections if Orthanc acts as SCU (client): " - << seconds << " seconds (0 = no timeout)"; + CLOG(INFO, DICOM) << "Default timeout for DICOM connections if Orthanc acts as SCU (client): " + << seconds << " seconds (0 = no timeout)"; { boost::mutex::scoped_lock lock(defaultTimeoutMutex_); diff -r 6b58ceed959e -r 756126cd2219 OrthancFramework/Sources/DicomNetworking/DicomControlUserConnection.cpp --- a/OrthancFramework/Sources/DicomNetworking/DicomControlUserConnection.cpp Wed Nov 04 14:48:52 2020 +0100 +++ b/OrthancFramework/Sources/DicomNetworking/DicomControlUserConnection.cpp Wed Nov 04 15:01:47 2020 +0100 @@ -166,7 +166,7 @@ const DicomTag& tag = query.GetElement(i).GetTag(); if (allowedTags.find(tag) == allowedTags.end()) { - LOG(WARNING) << "Tag not allowed for this C-Find level, will be ignored: " << tag; + CLOG(WARNING, DICOM) << "Tag not allowed for this C-Find level, will be ignored: " << tag; } else { diff -r 6b58ceed959e -r 756126cd2219 OrthancFramework/Sources/DicomNetworking/DicomServer.cpp --- a/OrthancFramework/Sources/DicomNetworking/DicomServer.cpp Wed Nov 04 14:48:52 2020 +0100 +++ b/OrthancFramework/Sources/DicomNetworking/DicomServer.cpp Wed Nov 04 15:01:47 2020 +0100 @@ -48,7 +48,7 @@ void DicomServer::ServerThread(DicomServer* server) { - LOG(INFO) << "DICOM server started"; + CLOG(INFO, DICOM) << "DICOM server started"; while (server->continue_) { @@ -65,11 +65,11 @@ } catch (OrthancException& e) { - LOG(ERROR) << "Exception in the DICOM server thread: " << e.What(); + CLOG(ERROR, DICOM) << "Exception in the DICOM server thread: " << e.What(); } } - LOG(INFO) << "DICOM server stopping"; + CLOG(INFO, DICOM) << "DICOM server stopping"; } @@ -95,7 +95,7 @@ { if (continue_) { - LOG(ERROR) << "INTERNAL ERROR: DicomServer::Stop() should be invoked manually to avoid mess in the destruction order!"; + CLOG(ERROR, DICOM) << "INTERNAL ERROR: DicomServer::Stop() should be invoked manually to avoid mess in the destruction order!"; Stop(); } } @@ -113,8 +113,8 @@ void DicomServer::SetAssociationTimeout(uint32_t seconds) { - LOG(INFO) << "Setting timeout for DICOM connections if Orthanc acts as SCP (server): " - << seconds << " seconds (0 = no timeout)"; + CLOG(INFO, DICOM) << "Setting timeout for DICOM connections if Orthanc acts as SCP (server): " + << seconds << " seconds (0 = no timeout)"; Stop(); associationTimeout_ = seconds; @@ -156,7 +156,7 @@ isdigit(aet[i]) || (aet[i] >= 'A' && aet[i] <= 'Z'))) { - LOG(WARNING) << "For best interoperability, only upper case, alphanumeric characters should be present in AET: \"" << aet << "\""; + CLOG(WARNING, DICOM) << "For best interoperability, only upper case, alphanumeric characters should be present in AET: \"" << aet << "\""; break; } } @@ -392,7 +392,7 @@ OFCondition cond = ASC_dropNetwork(&pimpl_->network_); if (cond.bad()) { - LOG(ERROR) << "Error while dropping the network: " << cond.text(); + CLOG(ERROR, DICOM) << "Error while dropping the network: " << cond.text(); } } } diff -r 6b58ceed959e -r 756126cd2219 OrthancFramework/Sources/DicomNetworking/DicomStoreUserConnection.cpp --- a/OrthancFramework/Sources/DicomNetworking/DicomStoreUserConnection.cpp Wed Nov 04 14:48:52 2020 +0100 +++ b/OrthancFramework/Sources/DicomNetworking/DicomStoreUserConnection.cpp Wed Nov 04 15:01:47 2020 +0100 @@ -227,15 +227,15 @@ // The association must be re-negotiated if (association_->IsOpen()) { - LOG(INFO) << "Re-negotiating DICOM association with " - << parameters_.GetRemoteModality().GetApplicationEntityTitle(); + CLOG(INFO, DICOM) << "Re-negotiating DICOM association with " + << parameters_.GetRemoteModality().GetApplicationEntityTitle(); if (proposedOriginalClasses_.find(std::make_pair(sopClassUid, transferSyntax)) != proposedOriginalClasses_.end()) { - LOG(INFO) << "The remote modality has already rejected SOP class UID \"" - << sopClassUid << "\" with transfer syntax \"" - << GetTransferSyntaxUid(transferSyntax) << "\", don't renegotiate"; + CLOG(INFO, DICOM) << "The remote modality has already rejected SOP class UID \"" + << sopClassUid << "\" with transfer syntax \"" + << GetTransferSyntaxUid(transferSyntax) << "\", don't renegotiate"; return false; } } diff -r 6b58ceed959e -r 756126cd2219 OrthancFramework/Sources/DicomNetworking/Internals/CommandDispatcher.cpp --- a/OrthancFramework/Sources/DicomNetworking/Internals/CommandDispatcher.cpp Wed Nov 04 14:48:52 2020 +0100 +++ b/OrthancFramework/Sources/DicomNetworking/Internals/CommandDispatcher.cpp Wed Nov 04 15:01:47 2020 +0100 @@ -29,44 +29,44 @@ Program: DCMTK 3.6.0 Module: http://dicom.offis.de/dcmtk.php.en -Copyright (C) 1994-2011, OFFIS e.V. -All rights reserved. + Copyright (C) 1994-2011, OFFIS e.V. + All rights reserved. -This software and supporting documentation were developed by + This software and supporting documentation were developed by OFFIS e.V. R&D Division Health Escherweg 2 26121 Oldenburg, Germany -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: -- Redistributions of source code must retain the above copyright + - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright + - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -- Neither the name of OFFIS nor the names of its contributors may be + - Neither the name of OFFIS nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -=========================================================================*/ + =========================================================================*/ #include "../../PrecompiledHeaders.h" @@ -92,7 +92,7 @@ #include - static OFBool opt_rejectWithoutImplementationUID = OFFalse; +static OFBool opt_rejectWithoutImplementationUID = OFFalse; @@ -237,14 +237,14 @@ OFCondition cond = ASC_dropSCPAssociation(assoc); if (cond.bad()) { - LOG(ERROR) << cond.text(); + CLOG(ERROR, DICOM) << cond.text(); return cond; } cond = ASC_destroyAssociation(&assoc); if (cond.bad()) { - LOG(ERROR) << cond.text(); + CLOG(ERROR, DICOM) << cond.text(); return cond; } @@ -278,7 +278,7 @@ // if some kind of error occured, take care of it if (cond.bad()) { - LOG(ERROR) << "Receiving Association failed: " << cond.text(); + CLOG(ERROR, DICOM) << "Receiving Association failed: " << cond.text(); // no matter what kind of error occurred, we need to do a cleanup AssociationCleanup(assoc); return NULL; @@ -327,8 +327,8 @@ calledAet = (/*OFSTRING_GUARD*/(calledAet_C)); } - LOG(INFO) << "Association Received from AET " << remoteAet - << " on IP " << remoteIp; + CLOG(INFO, DICOM) << "Association Received from AET " << remoteAet + << " on IP " << remoteIp; { @@ -378,7 +378,7 @@ &genericTransferSyntaxes[0], genericTransferSyntaxes.size()); if (cond.bad()) { - LOG(INFO) << cond.text(); + CLOG(INFO, DICOM) << cond.text(); AssociationCleanup(assoc); return NULL; } @@ -398,7 +398,7 @@ &genericTransferSyntaxes[0], genericTransferSyntaxes.size(), ASC_SC_ROLE_SCUSCP); if (cond.bad()) { - LOG(INFO) << cond.text(); + CLOG(INFO, DICOM) << cond.text(); AssociationCleanup(assoc); return NULL; } @@ -520,7 +520,7 @@ &storageTransferSyntaxes[0], storageTransferSyntaxes.size()); if (cond.bad()) { - LOG(INFO) << cond.text(); + CLOG(INFO, DICOM) << cond.text(); AssociationCleanup(assoc); return NULL; } @@ -562,7 +562,7 @@ assoc->params, pc.presentationContextID, storageTransferSyntaxes[k], role); if (cond.bad()) { - LOG(INFO) << cond.text(); + CLOG(INFO, DICOM) << cond.text(); AssociationCleanup(assoc); return NULL; } @@ -584,7 +584,7 @@ assoc->params, &storageTransferSyntaxes[0], storageTransferSyntaxes.size(), ASC_SC_ROLE_DEFAULT); if (cond.bad()) { - LOG(INFO) << cond.text(); + CLOG(INFO, DICOM) << cond.text(); AssociationCleanup(assoc); return NULL; } @@ -611,11 +611,11 @@ ASC_REASON_SU_APPCONTEXTNAMENOTSUPPORTED }; - LOG(INFO) << "Association Rejected: Bad Application Context Name: " << buf; + CLOG(INFO, DICOM) << "Association Rejected: Bad Application Context Name: " << buf; cond = ASC_rejectAssociation(assoc, &rej); if (cond.bad()) { - LOG(INFO) << cond.text(); + CLOG(INFO, DICOM) << cond.text(); } AssociationCleanup(assoc); return NULL; @@ -624,7 +624,7 @@ /* check the AETs */ if (!server.IsMyAETitle(calledAet)) { - LOG(WARNING) << "Rejected association, because of a bad called AET in the request (" << calledAet << ")"; + CLOG(WARNING, DICOM) << "Rejected association, because of a bad called AET in the request (" << calledAet << ")"; T_ASC_RejectParameters rej = { ASC_RESULT_REJECTEDPERMANENT, @@ -639,7 +639,7 @@ if (server.HasApplicationEntityFilter() && !server.GetApplicationEntityFilter().IsAllowedConnection(remoteIp, remoteAet, calledAet)) { - LOG(WARNING) << "Rejected association for remote AET " << remoteAet << " on IP " << remoteIp; + CLOG(WARNING, DICOM) << "Rejected association for remote AET " << remoteAet << " on IP " << remoteIp; T_ASC_RejectParameters rej = { ASC_RESULT_REJECTEDPERMANENT, @@ -662,11 +662,11 @@ ASC_REASON_SU_NOREASON }; - LOG(INFO) << "Association Rejected: No Implementation Class UID provided"; + CLOG(INFO, DICOM) << "Association Rejected: No Implementation Class UID provided"; cond = ASC_rejectAssociation(assoc, &rej); if (cond.bad()) { - LOG(INFO) << cond.text(); + CLOG(INFO, DICOM) << cond.text(); } AssociationCleanup(assoc); return NULL; @@ -676,13 +676,13 @@ cond = ASC_acknowledgeAssociation(assoc); if (cond.bad()) { - LOG(ERROR) << cond.text(); + CLOG(ERROR, DICOM) << cond.text(); AssociationCleanup(assoc); return NULL; } - LOG(INFO) << "Association Acknowledged (Max Send PDV: " << assoc->sendPDVLength << ")"; + CLOG(INFO, DICOM) << "Association Acknowledged (Max Send PDV: " << assoc->sendPDVLength << ")"; if (ASC_countAcceptedPresentationContexts(assoc->params) == 0) - LOG(INFO) << " (but no valid presentation contexts)"; + CLOG(INFO, DICOM) << " (but no valid presentation contexts)"; { OFString str; @@ -722,7 +722,7 @@ } catch (...) { - LOG(ERROR) << "Some association was not cleanly aborted"; + CLOG(ERROR, DICOM) << "Some association was not cleanly aborted"; } } @@ -820,7 +820,7 @@ default: // we cannot handle this kind of message cond = DIMSE_BADCOMMANDTYPE; - LOG(ERROR) << "cannot handle command: 0x" << std::hex << msg.CommandField; + CLOG(ERROR, DICOM) << "cannot handle command: 0x" << std::hex << msg.CommandField; break; } @@ -830,9 +830,9 @@ filter_ != NULL && !filter_->IsAllowedRequest(remoteIp_, remoteAet_, calledAet_, request)) { - LOG(WARNING) << "Rejected " << EnumerationToString(request) - << " request from remote DICOM modality with AET \"" - << remoteAet_ << "\" and hostname \"" << remoteIp_ << "\""; + CLOG(WARNING, DICOM) << "Rejected " << EnumerationToString(request) + << " request from remote DICOM modality with AET \"" + << remoteAet_ << "\" and hostname \"" << remoteIp_ << "\""; cond = DIMSE_ILLEGALASSOCIATION; supported = false; finished = true; @@ -931,24 +931,24 @@ // the peer or a network error finished = true; - LOG(INFO) << cond.text(); + CLOG(INFO, DICOM) << cond.text(); } if (finished) { if (cond == DUL_PEERREQUESTEDRELEASE) { - LOG(INFO) << "Association Release"; + CLOG(INFO, DICOM) << "Association Release"; ASC_acknowledgeRelease(assoc_); } else if (cond == DUL_PEERABORTEDASSOCIATION) { - LOG(INFO) << "Association Aborted"; + CLOG(INFO, DICOM) << "Association Aborted"; } else { OFString temp_str; - LOG(INFO) << "DIMSE failure (aborting association): " << cond.text(); + CLOG(INFO, DICOM) << "DIMSE failure (aborting association): " << cond.text(); /* some kind of error so abort the association */ ASC_abortAssociation(assoc_); } @@ -961,14 +961,13 @@ OFCondition EchoScp(T_ASC_Association * assoc, T_DIMSE_Message * msg, T_ASC_PresentationContextID presID) { OFString temp_str; - LOG(INFO) << "Received Echo Request"; - //LOG(DEBUG) << DIMSE_dumpMessage(temp_str, msg->msg.CEchoRQ, DIMSE_INCOMING, NULL, presID)); + CLOG(INFO, DICOM) << "Received Echo Request"; /* the echo succeeded !! */ OFCondition cond = DIMSE_sendEchoResponse(assoc, presID, &msg->msg.CEchoRQ, STATUS_Success, NULL); if (cond.bad()) { - LOG(ERROR) << "Echo SCP Failed: " << cond.text(); + CLOG(ERROR, DICOM) << "Echo SCP Failed: " << cond.text(); } return cond; } @@ -1145,13 +1144,13 @@ ReadSopSequence(sopClassUid, sopInstanceUid, NULL, *dataset, DCM_ReferencedSOPSequence, true /* mandatory */); - LOG(INFO) << "Incoming storage commitment request, with transaction UID: " << transactionUid; + CLOG(INFO, DICOM) << "Incoming storage commitment request, with transaction UID: " << transactionUid; for (size_t i = 0; i < sopClassUid.size(); i++) { - LOG(INFO) << " (" << (i + 1) << "/" << sopClassUid.size() - << ") queried SOP Class/Instance UID: " - << sopClassUid[i] << " / " << sopInstanceUid[i]; + CLOG(INFO, DICOM) << " (" << (i + 1) << "/" << sopClassUid.size() + << ") queried SOP Class/Instance UID: " + << sopClassUid[i] << " / " << sopInstanceUid[i]; } @@ -1176,7 +1175,7 @@ } catch (OrthancException& e) { - LOG(ERROR) << "Error while processing an incoming storage commitment request: " << e.What(); + CLOG(ERROR, DICOM) << "Error while processing an incoming storage commitment request: " << e.What(); // Code 0x0110 - "General failure in processing the operation was encountered" dimseStatus = STATUS_N_ProcessingFailure; @@ -1278,20 +1277,20 @@ *dataset, DCM_FailedSOPSequence, true); } - LOG(INFO) << "Incoming storage commitment report, with transaction UID: " << transactionUid; + CLOG(INFO, DICOM) << "Incoming storage commitment report, with transaction UID: " << transactionUid; for (size_t i = 0; i < successSopClassUid.size(); i++) { - LOG(INFO) << " (success " << (i + 1) << "/" << successSopClassUid.size() - << ") SOP Class/Instance UID: " - << successSopClassUid[i] << " / " << successSopInstanceUid[i]; + CLOG(INFO, DICOM) << " (success " << (i + 1) << "/" << successSopClassUid.size() + << ") SOP Class/Instance UID: " + << successSopClassUid[i] << " / " << successSopInstanceUid[i]; } for (size_t i = 0; i < failedSopClassUid.size(); i++) { - LOG(INFO) << " (failure " << (i + 1) << "/" << failedSopClassUid.size() - << ") SOP Class/Instance UID: " - << failedSopClassUid[i] << " / " << failedSopInstanceUid[i]; + CLOG(INFO, DICOM) << " (failure " << (i + 1) << "/" << failedSopClassUid.size() + << ") SOP Class/Instance UID: " + << failedSopClassUid[i] << " / " << failedSopInstanceUid[i]; } /** @@ -1316,7 +1315,7 @@ } catch (OrthancException& e) { - LOG(ERROR) << "Error while processing an incoming storage commitment report: " << e.What(); + CLOG(ERROR, DICOM) << "Error while processing an incoming storage commitment report: " << e.What(); // Code 0x0110 - "General failure in processing the operation was encountered" dimseStatus = STATUS_N_ProcessingFailure; diff -r 6b58ceed959e -r 756126cd2219 OrthancFramework/Sources/DicomNetworking/Internals/FindScp.cpp --- a/OrthancFramework/Sources/DicomNetworking/Internals/FindScp.cpp Wed Nov 04 14:48:52 2020 +0100 +++ b/OrthancFramework/Sources/DicomNetworking/Internals/FindScp.cpp Wed Nov 04 15:01:47 2020 +0100 @@ -21,6 +21,7 @@ + /*========================================================================= This file is based on portions of the following project: @@ -28,44 +29,44 @@ Program: DCMTK 3.6.0 Module: http://dicom.offis.de/dcmtk.php.en -Copyright (C) 1994-2011, OFFIS e.V. -All rights reserved. + Copyright (C) 1994-2011, OFFIS e.V. + All rights reserved. -This software and supporting documentation were developed by + This software and supporting documentation were developed by OFFIS e.V. R&D Division Health Escherweg 2 26121 Oldenburg, Germany -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: -- Redistributions of source code must retain the above copyright + - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright + - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -- Neither the name of OFFIS nor the names of its contributors may be + - Neither the name of OFFIS nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -=========================================================================*/ + =========================================================================*/ @@ -242,7 +243,7 @@ } else { - LOG(ERROR) << "No worklist handler is installed, cannot handle this C-FIND request"; + CLOG(ERROR, DICOM) << "No worklist handler is installed, cannot handle this C-FIND request"; } } else @@ -263,9 +264,9 @@ DcmSequenceOfItems& sequence = dynamic_cast(*element); if (sequence.card() != 0) { - LOG(WARNING) << "Orthanc only supports sequence matching on worklists, " - << "ignoring C-FIND SCU constraint on tag (" << tag.Format() - << ") " << FromDcmtkBridge::GetTagName(*element); + CLOG(WARNING, DICOM) << "Orthanc only supports sequence matching on worklists, " + << "ignoring C-FIND SCU constraint on tag (" << tag.Format() + << ") " << FromDcmtkBridge::GetTagName(*element); } sequencesToReturn.push_back(tag); @@ -286,14 +287,14 @@ } else { - LOG(ERROR) << "No C-Find handler is installed, cannot handle this request"; + CLOG(ERROR, DICOM) << "No C-Find handler is installed, cannot handle this request"; } } } catch (OrthancException& e) { // Internal error! - LOG(ERROR) << "C-FIND request handler has failed: " << e.What(); + CLOG(ERROR, DICOM) << "C-FIND request handler has failed: " << e.What(); } if (!ok) @@ -328,7 +329,7 @@ else { // Success, but the results were too numerous and had to be cropped - LOG(WARNING) << "Too many results for an incoming C-FIND query"; + CLOG(WARNING, DICOM) << "Too many results for an incoming C-FIND query"; response->DimseStatus = STATUS_FIND_Cancel_MatchingTerminatedDueToCancelRequest; *responseIdentifiers = NULL; } @@ -365,7 +366,7 @@ if (cond.bad()) { OFString temp_str; - LOG(ERROR) << "Find SCP Failed: " << cond.text(); + CLOG(ERROR, DICOM) << "Find SCP Failed: " << cond.text(); } return cond; diff -r 6b58ceed959e -r 756126cd2219 OrthancFramework/Sources/DicomNetworking/Internals/GetScp.cpp --- a/OrthancFramework/Sources/DicomNetworking/Internals/GetScp.cpp Wed Nov 04 14:48:52 2020 +0100 +++ b/OrthancFramework/Sources/DicomNetworking/Internals/GetScp.cpp Wed Nov 04 15:01:47 2020 +0100 @@ -220,7 +220,7 @@ catch (OrthancException& e) { // Internal error! - LOG(ERROR) << "IGetRequestHandler Failed: " << e.What(); + CLOG(ERROR, DICOM) << "IGetRequestHandler Failed: " << e.What(); response->DimseStatus = STATUS_GET_Failed_UnableToProcess; return; } @@ -230,14 +230,14 @@ else if (data.lastRequest_ != requestIdentifiers) { // Internal error! - LOG(ERROR) << "IGetRequestHandler Failed: Internal error lastRequestIdentifier"; + CLOG(ERROR, DICOM) << "IGetRequestHandler Failed: Internal error lastRequestIdentifier"; response->DimseStatus = STATUS_GET_Failed_UnableToProcess; return; } if (data.canceled_) { - LOG(ERROR) << "IGetRequestHandler Failed: Cannot pursue a request that was canceled by the SCU"; + CLOG(ERROR, DICOM) << "IGetRequestHandler Failed: Cannot pursue a request that was canceled by the SCU"; response->DimseStatus = STATUS_GET_Failed_UnableToProcess; return; } @@ -261,7 +261,7 @@ catch (OrthancException& e) { // Internal error! - LOG(ERROR) << "IGetRequestHandler Failed: " << e.What(); + CLOG(ERROR, DICOM) << "IGetRequestHandler Failed: " << e.What(); FillResponse(*response, responseIdentifiers, *data.handler_); // Fix the status code that is computed by "FillResponse()" @@ -311,7 +311,7 @@ if (cond.bad()) { OFString temp_str; - LOG(ERROR) << "Get SCP Failed: " << cond.text(); + CLOG(ERROR, DICOM) << "Get SCP Failed: " << cond.text(); } return cond; diff -r 6b58ceed959e -r 756126cd2219 OrthancFramework/Sources/DicomNetworking/Internals/MoveScp.cpp --- a/OrthancFramework/Sources/DicomNetworking/Internals/MoveScp.cpp Wed Nov 04 14:48:52 2020 +0100 +++ b/OrthancFramework/Sources/DicomNetworking/Internals/MoveScp.cpp Wed Nov 04 15:01:47 2020 +0100 @@ -136,8 +136,8 @@ } catch (boost::bad_lexical_cast&) { - LOG(WARNING) << "Cannot convert the Message ID (\"" << value->GetContent() - << "\") of an incoming C-MOVE request to an integer, assuming zero"; + CLOG(WARNING, DICOM) << "Cannot convert the Message ID (\"" << value->GetContent() + << "\") of an incoming C-MOVE request to an integer, assuming zero"; } } @@ -195,7 +195,7 @@ catch (OrthancException& e) { // Internal error! - LOG(ERROR) << "IMoveRequestHandler Failed: " << e.What(); + CLOG(ERROR, DICOM) << "IMoveRequestHandler Failed: " << e.What(); response->DimseStatus = STATUS_MOVE_Failed_UnableToProcess; return; } @@ -224,7 +224,7 @@ catch (OrthancException& e) { // Internal error! - LOG(ERROR) << "IMoveRequestHandler Failed: " << e.What(); + CLOG(ERROR, DICOM) << "IMoveRequestHandler Failed: " << e.What(); response->DimseStatus = STATUS_MOVE_Failed_UnableToProcess; return; } @@ -282,7 +282,7 @@ if (cond.bad()) { OFString temp_str; - LOG(ERROR) << "Move SCP Failed: " << cond.text(); + CLOG(ERROR, DICOM) << "Move SCP Failed: " << cond.text(); } return cond; diff -r 6b58ceed959e -r 756126cd2219 OrthancFramework/Sources/DicomNetworking/Internals/StoreScp.cpp --- a/OrthancFramework/Sources/DicomNetworking/Internals/StoreScp.cpp Wed Nov 04 14:48:52 2020 +0100 +++ b/OrthancFramework/Sources/DicomNetworking/Internals/StoreScp.cpp Wed Nov 04 15:01:47 2020 +0100 @@ -29,44 +29,44 @@ Program: DCMTK 3.6.0 Module: http://dicom.offis.de/dcmtk.php.en -Copyright (C) 1994-2011, OFFIS e.V. -All rights reserved. + Copyright (C) 1994-2011, OFFIS e.V. + All rights reserved. -This software and supporting documentation were developed by + This software and supporting documentation were developed by OFFIS e.V. R&D Division Health Escherweg 2 26121 Oldenburg, Germany -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: -- Redistributions of source code must retain the above copyright + - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright + - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -- Neither the name of OFFIS nor the names of its contributors may be + - Neither the name of OFFIS nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -=========================================================================*/ + =========================================================================*/ #include "../../PrecompiledHeaders.h" @@ -169,7 +169,7 @@ if (!FromDcmtkBridge::SaveToMemoryBuffer(buffer, **imageDataSet)) { - LOG(ERROR) << "cannot write DICOM file to memory"; + CLOG(ERROR, DICOM) << "cannot write DICOM file to memory"; rsp->DimseStatus = STATUS_STORE_Refused_OutOfResources; } } @@ -188,40 +188,40 @@ if (!DU_findSOPClassAndInstanceInDataSet(*imageDataSet, sopClass, sizeof(sopClass), sopInstance, sizeof(sopInstance), /*opt_correctUIDPadding*/ OFFalse)) #else - if (!DU_findSOPClassAndInstanceInDataSet(*imageDataSet, sopClass, sopInstance, /*opt_correctUIDPadding*/ OFFalse)) + if (!DU_findSOPClassAndInstanceInDataSet(*imageDataSet, sopClass, sopInstance, /*opt_correctUIDPadding*/ OFFalse)) #endif - { + { //LOG4CPP_ERROR(Internals::GetLogger(), "bad DICOM file: " << fileName); rsp->DimseStatus = STATUS_STORE_Error_CannotUnderstand; - } - else if (strcmp(sopClass, req->AffectedSOPClassUID) != 0) - { - rsp->DimseStatus = STATUS_STORE_Error_DataSetDoesNotMatchSOPClass; - } - else if (strcmp(sopInstance, req->AffectedSOPInstanceUID) != 0) - { - rsp->DimseStatus = STATUS_STORE_Error_DataSetDoesNotMatchSOPClass; - } - else - { - try + } + else if (strcmp(sopClass, req->AffectedSOPClassUID) != 0) + { + rsp->DimseStatus = STATUS_STORE_Error_DataSetDoesNotMatchSOPClass; + } + else if (strcmp(sopInstance, req->AffectedSOPInstanceUID) != 0) + { + rsp->DimseStatus = STATUS_STORE_Error_DataSetDoesNotMatchSOPClass; + } + else { - cbdata->handler->Handle(buffer, summary, dicomJson, *cbdata->remoteIp, cbdata->remoteAET, cbdata->calledAET); - } - catch (OrthancException& e) - { - rsp->DimseStatus = STATUS_STORE_Refused_OutOfResources; + try + { + cbdata->handler->Handle(buffer, summary, dicomJson, *cbdata->remoteIp, cbdata->remoteAET, cbdata->calledAET); + } + catch (OrthancException& e) + { + rsp->DimseStatus = STATUS_STORE_Refused_OutOfResources; - if (e.GetErrorCode() == ErrorCode_InexistentTag) - { - summary.LogMissingTagsForStore(); - } - else - { - LOG(ERROR) << "Exception while storing DICOM: " << e.What(); + if (e.GetErrorCode() == ErrorCode_InexistentTag) + { + summary.LogMissingTagsForStore(); + } + else + { + CLOG(ERROR, DICOM) << "Exception while storing DICOM: " << e.What(); + } } } - } } } } @@ -293,7 +293,7 @@ if (cond.bad()) { OFString temp_str; - LOG(ERROR) << "Store SCP Failed: " << cond.text(); + CLOG(ERROR, DICOM) << "Store SCP Failed: " << cond.text(); } // return return value diff -r 6b58ceed959e -r 756126cd2219 OrthancFramework/Sources/DicomNetworking/TimeoutDicomConnectionManager.cpp --- a/OrthancFramework/Sources/DicomNetworking/TimeoutDicomConnectionManager.cpp Wed Nov 04 14:48:52 2020 +0100 +++ b/OrthancFramework/Sources/DicomNetworking/TimeoutDicomConnectionManager.cpp Wed Nov 04 15:01:47 2020 +0100 @@ -91,8 +91,8 @@ { if (connection_.get() != NULL) { - LOG(INFO) << "Closing inactive DICOM association with modality: " - << connection_->GetParameters().GetRemoteModality().GetApplicationEntityTitle(); + CLOG(INFO, DICOM) << "Closing inactive DICOM association with modality: " + << connection_->GetParameters().GetRemoteModality().GetApplicationEntityTitle(); connection_.reset(NULL); }