diff --git a/src/lib/tvgCommon.h b/src/lib/tvgCommon.h index 52bdb5f2..e78a87f5 100644 --- a/src/lib/tvgCommon.h +++ b/src/lib/tvgCommon.h @@ -65,8 +65,11 @@ using namespace tvg; enum class FileType { Tvg = 0, Svg, Raw, Png, Jpg, Unknown }; #ifdef THORVG_LOG_ENABLED - #define TVGLOG(tag, fmt, ...) fprintf(stdout, tag ": " fmt "\n", ##__VA_ARGS__) //Log Message for notifying user some useful info - #define TVGERR(tag, fmt, ...) fprintf(stderr, tag ": " fmt "\n", ##__VA_ARGS__) //Error Message for us to fix it + constexpr auto ErrorColor = "\033[31m"; //red + constexpr auto LogColor = "\033[32m"; //green + constexpr auto ResetColor = "\033[0m"; //default + #define TVGERR(tag, fmt, ...) fprintf(stderr, "%s" tag " (%s l.%d): " fmt "%s\n", ErrorColor, __FILE__, __LINE__, ##__VA_ARGS__, ResetColor) + #define TVGLOG(tag, fmt, ...) fprintf(stderr, "%s" tag " (%s l.%d): " fmt "%s\n", LogColor, __FILE__, __LINE__, ##__VA_ARGS__, ResetColor) #else #define TVGERR(...) #define TVGLOG(...)