Created
April 6, 2018 16:22
-
-
Save kyoungho-koo/0e8736a8d257e776e364adef93852652 to your computer and use it in GitHub Desktop.
redefine printf for color log
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define DEBUG_LOG | |
#ifdef DEBUG_LOG | |
#define ANSI_COLOR_RED "\x1b[31m" | |
#define ANSI_COLOR_YELLOW "\x1b[33m" | |
#define ANSI_COLOR_RESET "\x1b[0m" | |
#define LOG(fmt,...) printf(ASNI_COLOR_YELLOW fmt "\n" ANSI_COLOR_RESET, ##__VA_ARGS__) | |
#define ERROR(fmt,...) printf(ANSI_COLOR_RED fmt "\n" ANSI_COLOR_RESET,##__VA_ARGS__) | |
#else | |
#define LOG(fmt,...) | |
#define ERROR(fmt,...) | |
#endif // DEBUG_LOG |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
빔신