1
0

🏗️」 wip(Ex03): Now with verbose mode ! (thx @bonsthie)

This commit is contained in:
2024-12-11 14:09:50 +01:00
parent 18ae71b63f
commit 7124f2072f
2 changed files with 11 additions and 3 deletions

View File

@ -1,12 +1,12 @@
/* ************************************************************************** */ /* ************************************************************************** */
/* */ /* */
/* ::: :::::::: */ /* ::: :::::::: */
/* log.cpp :+: :+: :+: */ /* Log.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */ /* +:+ +:+ +:+ */
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */ /* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/11/30 16:30:53 by adjoly #+# #+# */ /* Created: 2024/11/30 16:30:53 by adjoly #+# #+# */
/* Updated: 2024/11/30 16:32:37 by adjoly ### ########.fr */ /* Updated: 2024/12/11 14:09:08 by adjoly ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -14,9 +14,13 @@
#include <string> #include <string>
void log(std::string emoji, std::string what, std::string who, std::string str) { void log(std::string emoji, std::string what, std::string who, std::string str) {
#ifdef VERBOSE
if (who.empty()) if (who.empty())
std::cout << "" << emoji << "" << what << ": " << str << std::endl; std::cout << "" << emoji << "" << what << ": " << str << std::endl;
else else
std::cout << "" << emoji << "" << what << "(" << who << "): " << str << std::endl; std::cout << "" << emoji << "" << what << "(" << who << "): " << str << std::endl;
#else
(void)emoji, (void)what, (void)who, (void)str;
#endif
} }

View File

@ -6,7 +6,7 @@
# By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ # # By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ # # +#+#+#+#+#+ +#+ #
# Created: 2024/10/25 16:09:27 by adjoly #+# #+# # # Created: 2024/10/25 16:09:27 by adjoly #+# #+# #
# Updated: 2024/12/06 16:28:16 by adjoly ### ########.fr # # Updated: 2024/12/11 14:08:19 by adjoly ### ########.fr #
# # # #
# **************************************************************************** # # **************************************************************************** #
@ -31,6 +31,10 @@ PURPLE = \e[0;35m
NC = \033[0m NC = \033[0m
DELETE = \x1B[2K\r DELETE = \x1B[2K\r
ifeq ($(VERBOSE),true)
FLAGS += -D VERBOSE
endif
all: $(NAME) all: $(NAME)
$(NAME): $(OBJS) $(NAME): $(OBJS)