diff --git a/Makefile b/Makefile index 05c1abb..7633594 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ PARSER_PREFIXS = Command User Pass Nick Quit PARSER_FILES = $(addsuffix Parser, $(PARSER_PREFIXS)) PARSER_SRCS = $(addprefix $(PARSER_DIR), $(PARSER_FILES)) -FILES = main Server User Channel utils +FILES = main Server User Channel utils Logger SRCS_PATHS = $(addprefix $(SRC_DIR)/, $(FILES)) $(CMD_SRCS) $(PARSER_SRCS) SRCS = $(addsuffix .cpp, $(SRCS_PATHS)) diff --git a/includes/Logger.hpp b/includes/Logger.hpp index 368dd71..0346c5f 100644 --- a/includes/Logger.hpp +++ b/includes/Logger.hpp @@ -9,8 +9,10 @@ class Logger { Logger(void); ~Logger(void); + static const bool _debugMode = false; + public: static void debug(std::string message); }; -#endif \ No newline at end of file +#endif diff --git a/src/Logger.cpp b/src/Logger.cpp index aa70bc9..56e8166 100644 --- a/src/Logger.cpp +++ b/src/Logger.cpp @@ -5,7 +5,6 @@ Logger::Logger(void) {} Logger::~Logger(void) {} void Logger::debug(std::string message) { -#ifdef DEBUG - std::cout << "[DEBUG] " << message << std::endl; -#endif + if (Logger::_debugMode) + std::cout << "[DEBUG] " << message << std::endl; }