Skip to content

Commit

Permalink
Factor out the colors in sk_log
Browse files Browse the repository at this point in the history
  • Loading branch information
iWas-Coder committed Jun 1, 2024
1 parent ef407e2 commit 9228669
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions include/sk_log.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@
#include <raylib.h>

#define SK_LOG_ENABLE_DEBUG_LEVEL SetTraceLogLevel(LOG_DEBUG)
#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__)

#define SK_LOG_COLOR_RESET "\033[0m"
#define SK_LOG_COLOR_RED "\033[1;31m"
#define SK_LOG_COLOR_YELLOW "\033[1;33m"
#define SK_LOG_COLOR_MAGENTA "\033[1;35m"
#define SK_LOG_COLOR_CYAN "\033[1;36m"

#define SK_LOG_DEBUG(msg, ...) TraceLog(LOG_DEBUG, SK_LOG_COLOR_CYAN msg SK_LOG_COLOR_RESET, ##__VA_ARGS__)
#define SK_LOG_INFO(msg, ...) TraceLog(LOG_INFO, SK_LOG_COLOR_MAGENTA msg SK_LOG_COLOR_RESET, ##__VA_ARGS__)
#define SK_LOG_WARN(msg, ...) TraceLog(LOG_WARNING, SK_LOG_COLOR_YELLOW msg SK_LOG_COLOR_RESET, ##__VA_ARGS__)
#define SK_LOG_ERROR(msg, ...) TraceLog(LOG_ERROR, SK_LOG_COLOR_RED msg SK_LOG_COLOR_RESET, ##__VA_ARGS__)

0 comments on commit 9228669

Please sign in to comment.