comparison OrthancServer/Internals/MoveScp.cpp @ 101:428784e59dcd

trying to use log4cplus
author jodogne
date Wed, 03 Oct 2012 11:44:46 +0200
parents a70bb32802ae
children 7593b57dc1bf
comparison
equal deleted inserted replaced
100:27dc762e3dc8 101:428784e59dcd
23 #include <memory> 23 #include <memory>
24 24
25 #include "../FromDcmtkBridge.h" 25 #include "../FromDcmtkBridge.h"
26 #include "../ToDcmtkBridge.h" 26 #include "../ToDcmtkBridge.h"
27 #include "../../Core/OrthancException.h" 27 #include "../../Core/OrthancException.h"
28 #include "DcmtkLogging.h"
28 29
29 #include <dcmtk/dcmdata/dcfilefo.h> 30 #include <dcmtk/dcmdata/dcfilefo.h>
30 #include <dcmtk/dcmdata/dcmetinf.h> 31 #include <dcmtk/dcmdata/dcmetinf.h>
31 #include <dcmtk/dcmdata/dcostrmb.h> 32 #include <dcmtk/dcmdata/dcostrmb.h>
32 #include <dcmtk/dcmdata/dcdeftag.h> 33 #include <dcmtk/dcmdata/dcdeftag.h>
33 #include <dcmtk/dcmnet/diutil.h> 34 #include <dcmtk/dcmnet/diutil.h>
34 35
35 36
36 namespace Orthanc 37 namespace Orthanc
37 { 38 {
38 namespace Internals
39 {
40 extern OFLogger Logger;
41 }
42
43
44 namespace 39 namespace
45 { 40 {
46 struct MoveScpData 41 struct MoveScpData
47 { 42 {
48 std::string target_; 43 std::string target_;
85 data.warningCount_ = 0; 80 data.warningCount_ = 0;
86 } 81 }
87 catch (OrthancException& e) 82 catch (OrthancException& e)
88 { 83 {
89 // Internal error! 84 // Internal error!
90 OFLOG_ERROR(Internals::Logger, "IMoveRequestHandler Failed: " << e.What()); 85 LOG4CPP_ERROR(Internals::GetLogger(), "IMoveRequestHandler Failed: " + std::string(e.What()));
91 response->DimseStatus = STATUS_MOVE_Failed_UnableToProcess; 86 response->DimseStatus = STATUS_MOVE_Failed_UnableToProcess;
92 return; 87 return;
93 } 88 }
94 89
95 data.lastRequest_ = requestIdentifiers; 90 data.lastRequest_ = requestIdentifiers;
114 status = data.iterator_->DoNext(); 109 status = data.iterator_->DoNext();
115 } 110 }
116 catch (OrthancException& e) 111 catch (OrthancException& e)
117 { 112 {
118 // Internal error! 113 // Internal error!
119 OFLOG_ERROR(Internals::Logger, "IMoveRequestHandler Failed: " << e.What()); 114 LOG4CPP_ERROR(Internals::GetLogger(), "IMoveRequestHandler Failed: " + std::string(e.What()));
120 response->DimseStatus = STATUS_MOVE_Failed_UnableToProcess; 115 response->DimseStatus = STATUS_MOVE_Failed_UnableToProcess;
121 return; 116 return;
122 } 117 }
123 118
124 if (status == IMoveRequestIterator::Status_Failure) 119 if (status == IMoveRequestIterator::Status_Failure)
165 160
166 // if some error occured, dump corresponding information and remove the outfile if necessary 161 // if some error occured, dump corresponding information and remove the outfile if necessary
167 if (cond.bad()) 162 if (cond.bad())
168 { 163 {
169 OFString temp_str; 164 OFString temp_str;
170 OFLOG_ERROR(Internals::Logger, "Move SCP Failed: " << DimseCondition::dump(temp_str, cond)); 165 LOG4CPP_ERROR(Internals::GetLogger(), "Move SCP Failed: " + std::string(cond.text()));
171 } 166 }
172 167
173 return cond; 168 return cond;
174 } 169 }
175 } 170 }