Skip to content

Instantly share code, notes, and snippets.

@kyoungho-koo
Created April 6, 2018 16:22
Show Gist options
  • Save kyoungho-koo/0e8736a8d257e776e364adef93852652 to your computer and use it in GitHub Desktop.
Save kyoungho-koo/0e8736a8d257e776e364adef93852652 to your computer and use it in GitHub Desktop.
redefine printf for color log
#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
@hongmm23
Copy link

hongmm23 commented Apr 7, 2018

빔신

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment