Allow to disable logging by #defining "RELEASE".

This commit is contained in:
Felix Ableitner 2013-09-01 00:38:25 +02:00 committed by Felix Ableitner
parent bf87454682
commit 7644ca2db0
3 changed files with 13 additions and 2 deletions

View file

@ -232,7 +232,7 @@ Pathfinder::getArea(const Vector2f& point) const {
/** /**
* Draws areas. * Draws areas.
*/ */
#ifndef NDEBUG #ifndef RELEASE
void void
Pathfinder::draw(sf::RenderTarget& target, sf::RenderStates states) const { Pathfinder::draw(sf::RenderTarget& target, sf::RenderStates states) const {
for (auto& area : mAreas) { for (auto& area : mAreas) {

View file

@ -361,7 +361,7 @@ Generator::findClosestFloor(const Vector2i& start) const {
return Vector2i(); return Vector2i();
} }
#ifndef NDEBUG #ifndef RELEASE
/** /**
* Debug only: Draws paths generated by connectRooms. * Debug only: Draws paths generated by connectRooms.
* *

View file

@ -13,6 +13,15 @@
#include <SFML/System/Vector2.hpp> #include <SFML/System/Vector2.hpp>
#include <SFML/Graphics/Rect.hpp> #include <SFML/Graphics/Rect.hpp>
#ifdef RELEASE
#define LOG_E(str)
#define LOG_W(str)
#define LOG_D(str)
#define LOG_I(str)
#else
/** /**
* Logging functions for different levels. * Logging functions for different levels.
* *
@ -84,4 +93,6 @@ operator<<(std::ostream& os, const sf::IntRect& rect) {
return os; return os;
} }
#endif
#endif /* DG_LOG_H_ */ #endif /* DG_LOG_H_ */