diff options
Diffstat (limited to 'server/src/queryhandler.cc')
-rw-r--r-- | server/src/queryhandler.cc | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/server/src/queryhandler.cc b/server/src/queryhandler.cc index a6b6e1b..7077ab8 100644 --- a/server/src/queryhandler.cc +++ b/server/src/queryhandler.cc @@ -24,6 +24,8 @@ * along with Pracro; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#include "debug.h" + #include "queryhandler.h" #include <config.h> @@ -156,9 +158,7 @@ QueryResult QueryHandler::exec(Query &query) socket->write(header, strlen(header)); #endif/*WITHOUT_PENTOMINOS*/ -#ifdef WITH_DEBUG - printf(header); -#endif/*WITH_DEBUG*/ + PRACRO_DEBUG(pentominos, header); sprintf(buf, " <pentominos:entry cpr=\"%s\"\n" " src_addr=\"%s\"\n" @@ -179,9 +179,7 @@ QueryResult QueryHandler::exec(Query &query) socket->write(buf, strlen(buf)); #endif/*WITHOUT_PENTOMINOS*/ -#ifdef WITH_DEBUG - printf(buf); -#endif/*WITH_DEBUG*/ + PRACRO_DEBUG(pentominos, buf); sprintf(buf, " <pentominos:query format=\"pracroxml\"\n" " device_id=\"%s\"\n" @@ -195,9 +193,7 @@ QueryResult QueryHandler::exec(Query &query) socket->write(buf, strlen(buf)); #endif/*WITHOUT_PENTOMINOS*/ -#ifdef WITH_DEBUG - printf(buf); -#endif/*WITH_DEBUG*/ + PRACRO_DEBUG(pentominos, buf); sprintf(buf, "</artefact>"); @@ -205,10 +201,7 @@ QueryResult QueryHandler::exec(Query &query) socket->write(buf, strlen(buf)); #endif/*WITHOUT_PENTOMINOS*/ -#ifdef WITH_DEBUG - printf(buf); - fflush(stdout); -#endif/*WITH_DEBUG*/ + PRACRO_DEBUG(pentominos, buf); QueryResult result; @@ -226,7 +219,7 @@ QueryResult QueryHandler::exec(Query &query) result = parser.result; #endif/*WITHOUT_PENTOMINOS*/ - printf("Done handling query\n"); + PRACRO_DEBUG(pentominos, "Done handling query\n"); return result; } |