From e829b175730fb93081612392c9da8332c8d66586 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Wed, 5 Mar 2014 11:28:19 +0100 Subject: Use hugin module instead of old debug code. --- server/src/macroparser.cc | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'server/src/macroparser.cc') diff --git a/server/src/macroparser.cc b/server/src/macroparser.cc index 683c1d5..263d2c3 100644 --- a/server/src/macroparser.cc +++ b/server/src/macroparser.cc @@ -24,7 +24,7 @@ * 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 #include "macroparser.h" #include "configuration.h" @@ -54,22 +54,14 @@ void MacroParser::error(const char* fmt, ...) { - ERR_LOG(macro, "Error in MacroParser: "); - - { - va_list argp; - va_start(argp, fmt); - ERR_LOG_VA(macro, fmt, argp); - va_end(argp); - - fprintf(stderr, "\n"); - } + ERR(macro, "Error in MacroParser: "); { char *p; va_list argp; va_start(argp, fmt); if(vasprintf(&p, fmt, argp) != -1) { + ERR(macro, "%p", p); throw Exception("Error in MacroParser: " + std::string(p)); free(p); } @@ -360,12 +352,12 @@ void MacroParser::endTag(std::string name) int MacroParser::readData(char *data, size_t size) { if(fd == -1) { - ERR_LOG(macro, "Invalid file descriptor.\n"); + ERR(macro, "Invalid file descriptor.\n"); return 0; } ssize_t r = read(fd, data, size); if(r == -1) { - ERR_LOG(macro, "Could not read...%s\n", strerror(errno)); + ERR(macro, "Could not read...%s\n", strerror(errno)); return 0; } return r; @@ -373,11 +365,11 @@ int MacroParser::readData(char *data, size_t size) void MacroParser::parseError(const char *buf, size_t len, std::string error, int lineno) { - ERR_LOG(macro, "MacroParser[%s] error at line %d: %s\n", + ERR(macro, "MacroParser[%s] error at line %d: %s\n", file.c_str(), lineno, error.c_str()); - ERR_LOG(macro, "\tBuffer %u bytes: [", (int)len); + ERR(macro, "\tBuffer %u bytes: [", (int)len); if(fwrite(buf, len, 1, stderr) != len) {} - ERR_LOG(macro, "]\n"); + ERR(macro, "]\n"); char *slineno; if(asprintf(&slineno, " at line %d\n", lineno) != -1) { -- cgit v1.2.3