@@ -21,6 +21,9 @@ PythonServiceHandler::PythonServiceHandler(
2121void PythonServiceHandler::getFileTypes (
2222 std::vector<std::string>& return_)
2323{
24+ #ifndef NDEBUG
25+ LOG (info) << " [PYTHONSERVICE]" << __func__;
26+ #endif
2427 return_.push_back (" PY" );
2528 return_.push_back (" Dir" );
2629 return ;
@@ -30,7 +33,9 @@ void PythonServiceHandler::getAstNodeInfo(
3033 AstNodeInfo& return_,
3134 const core::AstNodeId& astNodeId_)
3235{
33- LOG (info) << " [PYSERVICE] " << __func__;
36+ #ifndef NDEBUG
37+ LOG (info) << " [PYTHONSERVICE]" << __func__;
38+ #endif
3439 model::PYName pyname = PythonServiceHandler::queryNodeByID (astNodeId_);
3540
3641 PythonServiceHandler::setInfoProperties (return_, pyname);
@@ -41,7 +46,9 @@ void PythonServiceHandler::getAstNodeInfoByPosition(
4146 AstNodeInfo& return_,
4247 const core::FilePosition& fpos_)
4348{
44- LOG (info) << " [PYSERVICE] " << __func__;
49+ #ifndef NDEBUG
50+ LOG (info) << " [PYTHONSERVICE]" << __func__;
51+ #endif
4552 model::PYName node = PythonServiceHandler::queryNodeByPosition (fpos_);
4653 PythonServiceHandler::setInfoProperties (return_, node);
4754 return ;
@@ -51,7 +58,9 @@ void PythonServiceHandler::getSourceText(
5158 std::string& return_,
5259 const core::AstNodeId& astNodeId_)
5360{
54- LOG (info) << " [PYSERVICE] " << __func__;
61+ #ifndef NDEBUG
62+ LOG (info) << " [PYTHONSERVICE]" << __func__;
63+ #endif
5564 model::PYName pyname = PythonServiceHandler::queryNodeByID (astNodeId_);
5665
5766 core::ProjectServiceHandler projectService (_db, _datadir, _context);
@@ -70,19 +79,11 @@ void PythonServiceHandler::getSourceText(
7079 return ;
7180}
7281
73- void PythonServiceHandler::getDocumentation (
74- std::string& return_,
75- const core::AstNodeId& astNodeId_)
76- {
77- LOG (info) << " [PYSERVICE] " << __func__;
78- return ;
79- }
80-
8182void PythonServiceHandler::getProperties (
8283 std::map<std::string, std::string>& return_,
8384 const core::AstNodeId& astNodeId_)
8485{
85- LOG (info) << " [PYSERVICE] " << __func__;
86+ LOG (info) << " [PYTHONSERVICE] " << __func__;
8687 model::PYName pyname = PythonServiceHandler::queryNodeByID (astNodeId_);
8788
8889 if (!pyname.full_name .empty ())
@@ -112,7 +113,9 @@ void PythonServiceHandler::getDiagramTypes(
112113 std::map<std::string, std::int32_t >& return_,
113114 const core::AstNodeId& astNodeId_)
114115{
115- LOG (info) << " [PYSERVICE] " << __func__;
116+ #ifndef NDEBUG
117+ LOG (info) << " [PYTHONSERVICE]" << __func__;
118+ #endif
116119 const model::PYName pyname = PythonServiceHandler::queryNodeByID (astNodeId_);
117120
118121 if (pyname.is_import == true ) return ;
@@ -144,7 +147,9 @@ void PythonServiceHandler::getDiagram(
144147 const core::AstNodeId& astNodeId_,
145148 const std::int32_t diagramId_)
146149{
147- LOG (info) << " [PYSERVICE] " << __func__;
150+ #ifndef NDEBUG
151+ LOG (info) << " [PYTHONSERVICE]" << __func__;
152+ #endif
148153 python::Diagram diagram (_db, _datadir, _context);
149154
150155 model::PYName pyname = PythonServiceHandler::queryNodeByID (astNodeId_);
@@ -179,7 +184,9 @@ void PythonServiceHandler::getDiagramLegend(
179184 std::string& return_,
180185 const std::int32_t diagramId_)
181186{
182- LOG (info) << " [PYSERVICE] " << __func__;
187+ #ifndef NDEBUG
188+ LOG (info) << " [PYTHONSERVICE]" << __func__;
189+ #endif
183190 python::Diagram diagram (_db, _datadir, _context);
184191
185192 util::Graph graph = [&]()
@@ -206,7 +213,9 @@ void PythonServiceHandler::getFileDiagramTypes(
206213 std::map<std::string, std::int32_t >& return_,
207214 const core::FileId& fileId_)
208215{
209- LOG (info) << " [PYSERVICE] " << __func__;
216+ #ifndef NDEBUG
217+ LOG (info) << " [PYTHONSERVICE]" << __func__;
218+ #endif
210219 return_.emplace (" Module dependency" , MODULE_DEPENDENCY);
211220 return ;
212221}
@@ -216,7 +225,9 @@ void PythonServiceHandler::getFileDiagram(
216225 const core::FileId& fileId_,
217226 const int32_t diagramId_)
218227{
219- LOG (info) << " [PYSERVICE] " << __func__;
228+ #ifndef NDEBUG
229+ LOG (info) << " [PYTHONSERVICE]" << __func__;
230+ #endif
220231 python::Diagram diagram (_db, _datadir, _context);
221232
222233 util::Graph graph = [&]()
@@ -240,7 +251,9 @@ void PythonServiceHandler::getFileDiagramLegend(
240251 std::string& return_,
241252 const std::int32_t diagramId_)
242253{
243- LOG (info) << " [PYSERVICE] " << __func__;
254+ #ifndef NDEBUG
255+ LOG (info) << " [PYTHONSERVICE]" << __func__;
256+ #endif
244257 python::Diagram diagram (_db, _datadir, _context);
245258
246259 util::Graph graph = [&]()
@@ -264,7 +277,9 @@ void PythonServiceHandler::getReferenceTypes(
264277 std::map<std::string, std::int32_t >& return_,
265278 const core::AstNodeId& astNodeId)
266279{
267- LOG (info) << " [PYSERVICE] " << __func__;
280+ #ifndef NDEBUG
281+ LOG (info) << " [PYTHONSERVICE]" << __func__;
282+ #endif
268283 return_.emplace (" Definition" , DEFINITION);
269284 return_.emplace (" Usage" , USAGE);
270285 return_.emplace (" Parent" , PARENT);
@@ -302,9 +317,10 @@ void PythonServiceHandler::getReferences(
302317 const std::int32_t referenceId_,
303318 const std::vector<std::string>& tags_)
304319{
305- LOG (info) << " [PYSERVICE] " << __func__;
320+ #ifndef NDEBUG
321+ LOG (info) << " [PYTHONSERVICE]" << __func__;
306322 LOG (info) << " astNodeID: " << astNodeId_;
307-
323+ # endif
308324 std::vector<model::PYName> nodes = PythonServiceHandler::queryReferences (astNodeId_, referenceId_);
309325
310326 for (const model::PYName& pyname : nodes)
@@ -321,67 +337,14 @@ std::int32_t PythonServiceHandler::getReferenceCount(
321337 const core::AstNodeId& astNodeId_,
322338 const std::int32_t referenceId_)
323339{
324- LOG (info) << " [PYSERVICE] " << __func__;
340+ #ifndef NDEBUG
341+ LOG (info) << " [PYTHONSERVICE]" << __func__;
325342 LOG (info) << " astNodeID: " << astNodeId_;
343+ #endif
326344
327345 return PythonServiceHandler::queryReferences (astNodeId_, referenceId_).size ();
328346}
329347
330- void PythonServiceHandler::getReferencesInFile (
331- std::vector<AstNodeInfo>& return_,
332- const core::AstNodeId& astNodeId_,
333- const std::int32_t referenceId_,
334- const core::FileId& fileId_,
335- const std::vector<std::string>& tags_)
336- {
337- LOG (info) << " [PYSERVICE] " << __func__;
338- return ;
339- }
340-
341- void PythonServiceHandler::getReferencesPage (
342- std::vector<AstNodeInfo>& return_,
343- const core::AstNodeId& astNodeId_,
344- const std::int32_t referenceId_,
345- const std::int32_t pageSize_,
346- const std::int32_t pageNo_)
347- {
348- LOG (info) << " [PYSERVICE] " << __func__;
349- return ;
350- }
351-
352- void PythonServiceHandler::getFileReferenceTypes (
353- std::map<std::string, std::int32_t >& return_,
354- const core::FileId& fileId_)
355- {
356- LOG (info) << " [PYSERVICE] " << __func__;
357- return ;
358- }
359-
360- void PythonServiceHandler::getFileReferences (
361- std::vector<AstNodeInfo>& return_,
362- const core::FileId& fileId_,
363- const std::int32_t referenceId_)
364- {
365- LOG (info) << " [PYSERVICE] " << __func__;
366- return ;
367- }
368-
369- std::int32_t PythonServiceHandler::getFileReferenceCount (
370- const core::FileId& fileId_,
371- const std::int32_t referenceId_)
372- {
373- LOG (info) << " [PYSERVICE] " << __func__;
374- return 0 ;
375- }
376-
377- void PythonServiceHandler::getSyntaxHighlight (
378- std::vector<SyntaxHighlight>& return_,
379- const core::FileRange& range_)
380- {
381- LOG (info) << " [PYSERVICE] " << __func__;
382- return ;
383- }
384-
385348model::PYName PythonServiceHandler::queryNodeByID (const std::string& id)
386349{
387350 return _transaction ([&]()
@@ -393,7 +356,7 @@ model::PYName PythonServiceHandler::queryNodeByID(const std::string& id)
393356 {
394357 pyname = *nodes.begin ();
395358 }else {
396- LOG (info) << " [PYSERVICE ] Node not found! (id = " << id << " )" ;
359+ LOG (info) << " [PYTHONSERVICE ] Node not found! (id = " << id << " )" ;
397360 core::InvalidId ex;
398361 ex.__set_msg (" Node not found!" );
399362 throw ex;
@@ -427,7 +390,7 @@ model::PYName PythonServiceHandler::queryNodeByPosition(const core::FilePosition
427390 }
428391 }
429392 }else {
430- LOG (info) << " [PYSERVICE ] Node not found! (line = " << fpos.pos .line << " column = " << fpos.pos .column << " )" ;
393+ LOG (info) << " [PYTHONSERVICE ] Node not found! (line = " << fpos.pos .line << " column = " << fpos.pos .column << " )" ;
431394 core::InvalidInput ex;
432395 ex.__set_msg (" Node not found!" );
433396 throw ex;
0 commit comments