Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

put debug messages under debug flag #ifndef NDEBUG #271

Merged
merged 1 commit into from
Jun 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/pointer_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ namespace grpc_labview
auto storedPtr = _registeredPointers.find(ptr);
if (storedPtr == _registeredPointers.end())
{
#ifndef NDEBUG
std::cerr << "ERROR: THIS POINTER IS NOT REGISTERED" << std::endl;
#endif // ! NDEBUG
if (status != nullptr)
{
*status = -1;
Expand All @@ -83,7 +85,9 @@ namespace grpc_labview
std::shared_ptr<TDerivedType> derivedPtr = std::dynamic_pointer_cast<TDerivedType>(storedPtr->second);
if (!derivedPtr)
{
#ifndef NDEBUG
std::cerr << "ERROR: CASTING POINTER TO MORE SPECIFIC TYPE FAILED" << std::endl;
#endif // ! NDEBUG
if (status != nullptr)
{
*status = -1;
Expand All @@ -100,7 +104,9 @@ namespace grpc_labview
std::lock_guard<std::mutex> lock(_mutex);
if (!ptr)
{
#ifndef NDEBUG
std::cerr << "ERROR: CANNOT REGISTER A NULL POINTER" << std::endl;
#endif // ! NDEBUG
return nullptr;
}

Expand All @@ -117,7 +123,9 @@ namespace grpc_labview
std::lock_guard<std::mutex> lock(_mutex);
if (!ptr)
{
#ifndef NDEBUG
std::cerr << "ERROR: CANNOT REGISTER A NULL POINTER" << std::endl;
#endif // ! NDEBUG
return nullptr;
}

Expand Down
Loading