aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/vespa/vespalib/util/hdr_abort.cpp
blob: bd2022ca5ae048b775e1873eb15dbf61ca7177fd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "hdr_abort.h"
#include <cstdlib>
#include <cstdio>

#include <vespa/log/log.h>
LOG_SETUP(".vespalib");

namespace vespalib {

void hdr_abort(const char *message,
               const char *file,
               unsigned int line)
{
    LOG(error, "%s:%d: Abort called. Reason: %s",
        file, line, message);
    fprintf(stderr, "%s:%d: Abort called. Reason: %s\n",
            file, line, message);
    abort();
}

} // namespace vespalib