#ifndef GRPC_SRC_CORE_LIB_GPR_LOG_INTERNAL_H
#define GRPC_SRC_CORE_LIB_GPR_LOG_INTERNAL_H
#include <grpc/support/port_platform.h>
#include <stdio.h>
#include <stdlib.h>
#include <cstring>
#define GPR_ASSERT_INTERNAL(x) \
do { \
if (GPR_UNLIKELY(!(x))) { \
fprintf(stderr, "assertion failed: %s", #x); \
abort(); \
} \
} while (0)
#ifndef NDEBUG
#define GPR_DEBUG_ASSERT_INTERNAL(x) GPR_ASSERT_INTERNAL(x)
#else
#define GPR_DEBUG_ASSERT_INTERNAL(x)
#endif
#define GPR_LOG_ERROR_INTERNAL(format, ...) \
do { \
char f[] = __FILE__; \
char* display_file = f; \
char* slash_pos = strrchr(f, '/'); \
if (slash_pos != nullptr) display_file = slash_pos + 1; \
char prefix[60]; \
sprintf(prefix, "INTERNAL %37s:%d]", display_file, __LINE__); \
fprintf(stderr, "%-60s " format "\n", prefix, __VA_ARGS__); \
} while (0)
#endif