diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2018-12-07 09:02:29 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2018-12-07 09:02:29 +0000 |
commit | 66b2121207b024b00f9663c4f5ddb2b9fd25951d (patch) | |
tree | fe0098ceae5a4db1f1dc489adaada27ff59603a6 /staging_vespalib | |
parent | c6011003d7866f62488a638a99c501b90efe7170 (diff) |
Update copyright and add stack trace when logging assert.
Diffstat (limited to 'staging_vespalib')
4 files changed, 8 insertions, 6 deletions
diff --git a/staging_vespalib/src/tests/assert/CMakeLists.txt b/staging_vespalib/src/tests/assert/CMakeLists.txt index 88030680cfb..7403a488645 100644 --- a/staging_vespalib/src/tests/assert/CMakeLists.txt +++ b/staging_vespalib/src/tests/assert/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +# Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. vespa_add_executable(staging_vespalib_assert_test_app TEST SOURCES diff --git a/staging_vespalib/src/tests/assert/assert_test.cpp b/staging_vespalib/src/tests/assert/assert_test.cpp index d1a27fbf73c..4ca962a746c 100644 --- a/staging_vespalib/src/tests/assert/assert_test.cpp +++ b/staging_vespalib/src/tests/assert/assert_test.cpp @@ -1,4 +1,4 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/vespalib/testkit/test_kit.h> #include <vespa/vespalib/util/slaveproc.h> #include <vespa/vespalib/util/stringfmt.h> diff --git a/staging_vespalib/src/tests/assert/asserter.cpp b/staging_vespalib/src/tests/assert/asserter.cpp index f1be7531575..da9de5eb099 100644 --- a/staging_vespalib/src/tests/assert/asserter.cpp +++ b/staging_vespalib/src/tests/assert/asserter.cpp @@ -1,4 +1,4 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/vespalib/util/assert.h> #include <cassert> #include <cstdlib> diff --git a/staging_vespalib/src/vespa/vespalib/util/assert.cpp b/staging_vespalib/src/vespa/vespalib/util/assert.cpp index 976c227a413..fe3f66713b2 100644 --- a/staging_vespalib/src/vespa/vespalib/util/assert.cpp +++ b/staging_vespalib/src/vespa/vespalib/util/assert.cpp @@ -2,7 +2,7 @@ #include "assert.h" #include <vespa/defaults.h> - +#include <vespa/vespalib/util/backtrace.h> #include <fstream> #include <map> #include <mutex> @@ -42,11 +42,13 @@ void assertOnceOrLog(const char *expr, const char *key, size_t freq) count = _G_assertMap[key]++; } if ((count % freq) == 0) { - LOG(error,"assert(%s) named '%s' has failed %zu times", expr, key, count+1); + LOG(error, "assert(%s) named '%s' has failed %zu times. Stacktrace = %s", + expr, key, count+1, vespalib::getStackTrace(0).c_str()); } } else { { - LOG(error, "assert(%s) named '%s' failed first time.", expr, key); + LOG(error, "assert(%s) named '%s' failed first time. Stacktrace = %s", + expr, key, vespalib::getStackTrace(0).c_str()); std::ofstream assertStream(rememberAssert.c_str()); std::chrono::time_point now = std::chrono::system_clock::now(); std::time_t now_c = std::chrono::system_clock::to_time_t(now); |