From 7644ca2db0ba908c10f2b02962aadd618a029aa7 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Sun, 1 Sep 2013 00:38:25 +0200 Subject: [PATCH] Allow to disable logging by #defining "RELEASE". --- src/Pathfinder.cpp | 2 +- src/generator/Generator.cpp | 2 +- src/util/Log.h | 11 +++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/Pathfinder.cpp b/src/Pathfinder.cpp index 07ef2ae..2341d82 100644 --- a/src/Pathfinder.cpp +++ b/src/Pathfinder.cpp @@ -232,7 +232,7 @@ Pathfinder::getArea(const Vector2f& point) const { /** * Draws areas. */ -#ifndef NDEBUG +#ifndef RELEASE void Pathfinder::draw(sf::RenderTarget& target, sf::RenderStates states) const { for (auto& area : mAreas) { diff --git a/src/generator/Generator.cpp b/src/generator/Generator.cpp index 2ae4ef8..9bb1674 100644 --- a/src/generator/Generator.cpp +++ b/src/generator/Generator.cpp @@ -361,7 +361,7 @@ Generator::findClosestFloor(const Vector2i& start) const { return Vector2i(); } -#ifndef NDEBUG +#ifndef RELEASE /** * Debug only: Draws paths generated by connectRooms. * diff --git a/src/util/Log.h b/src/util/Log.h index 5361829..d4854c8 100644 --- a/src/util/Log.h +++ b/src/util/Log.h @@ -13,6 +13,15 @@ #include #include +#ifdef RELEASE + +#define LOG_E(str) +#define LOG_W(str) +#define LOG_D(str) +#define LOG_I(str) + +#else + /** * Logging functions for different levels. * @@ -84,4 +93,6 @@ operator<<(std::ostream& os, const sf::IntRect& rect) { return os; } +#endif + #endif /* DG_LOG_H_ */