summaryrefslogtreecommitdiffstats
path: root/vespalib/src/apps
diff options
context:
space:
mode:
authorArne Juul <arnej@yahoo-inc.com>2018-06-12 12:50:28 +0200
committerArne Juul <arnej@yahoo-inc.com>2018-06-12 13:51:45 +0200
commit016e584f0ad5a071e13d75eb8ad5ddb46b8c54f5 (patch)
tree869d4e4a4c4b8a9f9ef691b2980009017dece9e6 /vespalib/src/apps
parent22796dddd3dc025018093783328ac87535ffecd9 (diff)
use LOG_ABORT not just abort()
* abort() has the unfortunate effect that nothing is seen in the log, just an event (which is usually not displayed); so ops people don't see that the program is crashing at all. * LOG_ABORT("message") will log an error with the message (and the file and line) before calling abort(), so it's easy to see what happened. * add or move <vespa/log/log.h> include and LOG_SETUP lines before LOG_ABORT is used (or included).
Diffstat (limited to 'vespalib/src/apps')
-rw-r--r--vespalib/src/apps/make_fixture_macros/make_fixture_macros.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/vespalib/src/apps/make_fixture_macros/make_fixture_macros.cpp b/vespalib/src/apps/make_fixture_macros/make_fixture_macros.cpp
index 6e23bd46d71..d15b925d31a 100644
--- a/vespalib/src/apps/make_fixture_macros/make_fixture_macros.cpp
+++ b/vespalib/src/apps/make_fixture_macros/make_fixture_macros.cpp
@@ -4,6 +4,9 @@
#include <stdlib.h>
#include <algorithm>
+#include <vespa/log/log.h>
+LOG_SETUP("make_fixture_macros");
+
void out(const char *str) { fprintf(stdout, "%s", str); }
void out_n(const char *str, int n) { fprintf(stdout, str, n); }
void out_nn(const char *str, int n) { fprintf(stdout, str, n, n); }
@@ -24,7 +27,7 @@ void out_list(const char *pre, const char *str, const char *sep, const char *pos
case 0: out(str); break;
case 1: out_n(str, i + 1); break;
case 2: out_nn(str, i + 1); break;
- default: abort();
+ default: LOG_ABORT("should not be reached");
}
}
out_if(post, n > 0);