From 016e584f0ad5a071e13d75eb8ad5ddb46b8c54f5 Mon Sep 17 00:00:00 2001 From: Arne Juul Date: Tue, 12 Jun 2018 12:50:28 +0200 Subject: 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 include and LOG_SETUP lines before LOG_ABORT is used (or included). --- streamingvisitors/src/tests/searchvisitor/searchvisitor.cpp | 4 ++++ streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'streamingvisitors') diff --git a/streamingvisitors/src/tests/searchvisitor/searchvisitor.cpp b/streamingvisitors/src/tests/searchvisitor/searchvisitor.cpp index 67b662fb16b..19d67b623eb 100644 --- a/streamingvisitors/src/tests/searchvisitor/searchvisitor.cpp +++ b/streamingvisitors/src/tests/searchvisitor/searchvisitor.cpp @@ -1,4 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +#include +LOG_SETUP("searchvisitor_test"); + #include #include #include diff --git a/streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp b/streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp index f42dfe5af98..f10d934bd2d 100644 --- a/streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp +++ b/streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp @@ -1,5 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#include +LOG_SETUP(".visitor.instance.searchvisitor"); + #include "querytermdata.h" #include "searchenvironment.h" #include "searchvisitor.h" @@ -16,9 +19,6 @@ #include #include -#include -LOG_SETUP(".visitor.instance.searchvisitor"); - namespace storage { using vsm::DocsumFilter; -- cgit v1.2.3