#ifndef GRPC_CORE_LIB_GPRPP_DEBUG_LOCATION_H
#define GRPC_CORE_LIB_GPRPP_DEBUG_LOCATION_H
namespace grpc_core {
#ifndef NDEBUG
class DebugLocation {
public:
DebugLocation(const char* file, int line) : file_(file), line_(line) {}
bool Log() const { return true; }
const char* file() const { return file_; }
int line() const { return line_; }
private:
const char* file_;
const int line_;
};
#define DEBUG_LOCATION ::grpc_core::DebugLocation(__FILE__, __LINE__)
#else
class DebugLocation {
public:
bool Log() const { return false; }
const char* file() const { return nullptr; }
int line() const { return -1; }
};
#define DEBUG_LOCATION ::grpc_core::DebugLocation()
#endif
}
#endif