Files
memgraph/src/utils/assert.hpp
Dominik Gleich fcecb14545 Replace debug_assert, permanent_assert with DCHECK/CHECK
Summary:
Phase 2.

Phase 3.

Phase 4.

Phase 5.

Complete refactor.

Reviewers: florijan, mislav.bradac

Reviewed By: mislav.bradac

Subscribers: mislav.bradac, pullbot

Differential Revision: https://phabricator.memgraph.io/D895
2017-10-11 14:43:32 +02:00

26 lines
719 B
C++

/**
* @file
* This file defines @c permanent_assert and @c debug_assert.
*
* If @c STACKTRACE_ASSERT_ON is defined, when an assertion fails, the full
* stack trace will be printed to @c stderr, otherwise just the basic
* information will be printed out (message, file, line)
*/
#pragma once
#include <cstdlib>
#include <iostream>
#include <sstream>
#include "utils/stacktrace.hpp"
#ifdef STACKTRACE_ASSERT_ON
#define __handle_assert_message(message) \
Stacktrace stacktrace; \
std::cerr << "ASSERT: " << message << std::endl; \
std::cerr << stacktrace.dump();
#else
#define __handle_assert_message(message) \
std::cerr << "ASSERT: " << message << std::endl;
#endif