summaryrefslogtreecommitdiff
path: root/server/src/templateheaderparser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/templateheaderparser.cc')
-rw-r--r--server/src/templateheaderparser.cc24
1 files changed, 8 insertions, 16 deletions
diff --git a/server/src/templateheaderparser.cc b/server/src/templateheaderparser.cc
index 3c327fd..7274af8 100644
--- a/server/src/templateheaderparser.cc
+++ b/server/src/templateheaderparser.cc
@@ -44,28 +44,20 @@
#include <errno.h>
#include <string.h>
-#include "debug.h"
+#include <hugin.hpp>
#include "configuration.h"
#include "exception.h"
void TemplateHeaderParser::error(const char* fmt, ...)
{
- ERR_LOG(templateparser, "Error in TemplateHeaderParser: ");
-
- {
- va_list argp;
- va_start(argp, fmt);
- ERR_LOG_VA(templateparser, fmt, argp);
- va_end(argp);
-
- fprintf(stderr, "\n");
- }
+ ERR(templateparser, "Error in TemplateHeaderParser: ");
{
char *p;
va_list argp;
va_start(argp, fmt);
if(vasprintf(&p, fmt, argp) != -1) {
+ ERR(templateparser, "%s", p);
throw Exception("Error in TemplateHeaderParser: " + std::string(p));
free(p);
}
@@ -115,12 +107,12 @@ int TemplateHeaderParser::readData(char *data, size_t size)
if(t) return 0;
if(fd == -1) {
- ERR_LOG(templateparser, "Invalid file descriptor.\n");
+ ERR(templateparser, "Invalid file descriptor.\n");
return 0;
}
ssize_t r = read(fd, data, size);
if(r == -1) {
- ERR_LOG(templateparser, "Could not read...%s\n", strerror(errno));
+ ERR(templateparser, "Could not read...%s\n", strerror(errno));
return 0;
}
return r;
@@ -132,11 +124,11 @@ void TemplateHeaderParser::parseError(const char *buf, size_t len,
// Ignore "unclosed token" errors when the template tag has been parsed.
if(t) return;
- ERR_LOG(templateparser, "TemplateHeaderParser[%s] error at line %d: %s\n",
+ ERR(templateparser, "TemplateHeaderParser[%s] error at line %d: %s\n",
file.c_str(), lineno, error.c_str());
- ERR_LOG(templateparser, "\tBuffer %u bytes: [", (int)len);
+ ERR(templateparser, "\tBuffer %u bytes: [", (int)len);
if(fwrite(buf, len, 1, stderr) != len) {}
- ERR_LOG(templateparser, "]\n");
+ ERR(templateparser, "]\n");
char *slineno;
if(asprintf(&slineno, " at line %d\n", lineno) != -1) {