Skip to content

Commit

Permalink
Added color to log output
Browse files Browse the repository at this point in the history
  • Loading branch information
iWas-Coder committed May 8, 2024
1 parent 88ff295 commit 548228b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
30 changes: 15 additions & 15 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ define LUA_CFLAGS
$(MACOS_SPECIFIC_CFLAGS_OPTS)
endef
define CFLAGS
-std=c11 \
-std=gnu11 \
-Wall \
-Wextra \
-pedantic \
Expand Down Expand Up @@ -249,27 +249,27 @@ all: checkdeps .WAIT $(BUILD_DIR) $(RAYLIB_BUILD_DIR) $(LUA_BUILD_DIR) game
@:

checkdeps:
@for i in $(CHECKDEPS_BINS); do \
if which $${i} >/dev/null 2>&1; then \
echo "checking for $${i}... yes"; \
else \
echo "checking for $${i}... no"; \
exit 1; \
fi; \
@for i in $(CHECKDEPS_BINS); do \
if which $${i} >/dev/null 2>&1; then \
printf "checking for $${i}... \033[1;32myes\033[0m\n"; \
else \
printf "checking for $${i}... \033[1;31mno\033[0m\n"; \
exit 1; \
fi; \
done
@for i in $(CHECKDEPS_HDRS); do \
if echo "#include <$${i}>" | $(CC) -E - >/dev/null 2>&1; then \
echo "checking for $${i}... yes"; \
printf "checking for $${i}... \033[1;32myes\033[0m\n"; \
else \
echo "checking for $${i}... no"; \
printf "checking for $${i}... \033[1;31mno\033[0m\n"; \
exit 1; \
fi; \
done
@for i in $(CHECKDEPS_TYPES); do \
if echo "#include <stdint.h>\n#include <stddef.h>\n$${i} x;" | gcc -x c -S - -o /dev/stdout >/dev/null 2>&1; then \
echo "checking for $${i}... yes"; \
printf "checking for $${i}... \033[1;32myes\033[0m\n"; \
else \
echo "checking for $${i}... no"; \
printf "checking for $${i}... \033[1;31mno\033[0m\n"; \
exit 1; \
fi; \
done
Expand All @@ -291,7 +291,7 @@ $(TEST_BUILD_DIR):
$(Q)mkdir -p $@

game: $(OUT)
@echo "INFO: $(OUT) is ready ($(FULL_VERSION))"
@printf "INFO: \033[1;35m$(OUT) is ready ($(FULL_VERSION))\033[0m\n"

$(OUT): $(RAYLIB_OUT) $(LUA_OUT) $(LAUNCHER_OUT) $(OBJS)
@echo " $(PPO_LD) $@"
Expand Down Expand Up @@ -327,7 +327,7 @@ $(BUILD_DIR)/%.o: $(SRC_DIR)/%.c
$(Q)$(CC) $(CPPFLAGS) $(CFLAGS) -c -MD $< -o $@

check: checkdeps .WAIT $(BUILD_DIR) $(RAYLIB_BUILD_DIR) $(LUA_BUILD_DIR) $(TEST_BUILD_DIR) $(TEST_OUT)
@echo "INFO: $(TEST_OUT) is ready ($(FULL_VERSION))"
@printf "INFO: \033[1;35m$(TEST_OUT) is ready ($(FULL_VERSION))\033[0m\n"
$(Q)./$(TEST_OUT)

$(TEST_OUT): $(RAYLIB_OUT) $(LUA_OUT) $(TEST_DEPS_OBJS) $(TEST_OBJS)
Expand All @@ -339,7 +339,7 @@ $(TEST_BUILD_DIR)/%.o: $(TEST_DIR)/$(SRC_DIR)/%.c
$(Q)$(CC) $(TEST_CPPFLAGS) $(TEST_CFLAGS) -c -MD $< -o $@

editor: checkdeps .WAIT $(EDITOR_OUT)
@echo "INFO: $(EDITOR_OUT) is ready ($(FULL_VERSION))"
@printf "INFO: \033[1;35m$(EDITOR_OUT) is ready ($(FULL_VERSION))\033[0m\n"

$(EDITOR_OUT): $(EDITOR_SRCS)
@if [ ! -e $(FIFO_RSC) ]; then \
Expand Down
2 changes: 1 addition & 1 deletion README.org
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ A 5v5 character-based libre tactical shooter
#+begin_html
<p align="center">
<img src="https://img.shields.io/github/license/sparky-game/sparky?color=blue" alt="License">
<img src="https://img.shields.io/badge/C-11-blue" alt="C Standard">
<img src="https://img.shields.io/badge/C-gnu11-blue" alt="C Standard">
<img src="https://img.shields.io/github/repo-size/sparky-game/sparky?color=blue" alt="Size">
<img src="https://img.shields.io/github/v/tag/sparky-game/sparky?color=blue" alt="Release">
<img src="https://img.shields.io/badge/speed-%F0%9F%94%A5blazing-blue" alt="Blazing Speed">
Expand Down
8 changes: 4 additions & 4 deletions include/sk_log.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <raylib.h>

#define SK_LOG_ENABLE_DEBUG_LEVEL SetTraceLogLevel(LOG_DEBUG)
#define SK_LOG_DEBUG(...) TraceLog(LOG_DEBUG, __VA_ARGS__)
#define SK_LOG_INFO(...) TraceLog(LOG_INFO, __VA_ARGS__)
#define SK_LOG_WARN(...) TraceLog(LOG_WARNING, __VA_ARGS__)
#define SK_LOG_ERROR(...) TraceLog(LOG_ERROR, __VA_ARGS__)
#define SK_LOG_DEBUG(msg, ...) TraceLog(LOG_DEBUG, "\033[1;36m" msg "\033[0m", ##__VA_ARGS__)
#define SK_LOG_INFO(msg, ...) TraceLog(LOG_INFO, "\033[1;35m" msg "\033[0m", ##__VA_ARGS__)
#define SK_LOG_WARN(msg, ...) TraceLog(LOG_WARNING, "\033[1;33m" msg "\033[0m", ##__VA_ARGS__)
#define SK_LOG_ERROR(msg, ...) TraceLog(LOG_ERROR, "\033[1;31m" msg "\033[0m", ##__VA_ARGS__)

0 comments on commit 548228b

Please sign in to comment.