30 #define UT_IFELSE(t, f) t
36 { myState = (
getenv(name) != 0); }
37 bool on()
const {
return myState; }
38 void setDebugFile(
const char *)
const;
39 void output(
const char *fmt, ...)
const;
48 #define UT_IFELSE(t, f) f
54 int on()
const {
return 0; }
55 void setDebugFile(
const char *)
const;
56 void output(
const char *, ...)
const;
62 UT_API void UTdbgout(
const char *file,
int lineno,
const char *text);
70 #if UT_ASSERT_LEVEL > 0
75 #define UTdebugFormat(...) do { \
76 UT_WorkBuffer dbostr; \
77 dbostr.format(__VA_ARGS__); \
78 UTdbgout(__FILE__, __LINE__, dbostr.buffer()); \
81 #define UTdebugFormatCd(color, ...) do { \
82 UT_WorkBuffer dbostr, cdstr; \
83 dbostr.format(__VA_ARGS__); \
84 if (strcmp(#color, "none") == 0) \
87 cdstr.sprintf("%s%s%s", UTconsoleColorString(#color), dbostr.buffer(), UTconsoleColorString("none")); \
88 UTdbgout(__FILE__, __LINE__, cdstr.buffer()); \
91 #define UTdebugPrint(...) do { \
92 UT_WorkBuffer dbostr; \
93 dbostr.print(__VA_ARGS__); \
94 UTdbgout(__FILE__, __LINE__, dbostr.buffer()); \
97 #define UTdebugPrintCd(color, ...) do { \
98 UT_WorkBuffer dbostr, cdstr; \
99 dbostr.print(__VA_ARGS__); \
100 if (strcmp(#color, "none") == 0) \
103 cdstr.sprintf("%s%s%s", UTconsoleColorString(#color), dbostr.buffer(), UTconsoleColorString("none")); \
104 UTdbgout(__FILE__, __LINE__, cdstr.buffer()); \
107 #define UT_DBGOUT(ZZ) do { \
108 UT_WorkBuffer dbostr; \
109 dbostr.sprintf ZZ ; \
110 UTdbgout(__FILE__, __LINE__, dbostr.buffer()); \
113 #define UT_DBGOS(ZZ) do { \
114 std::stringstream os; \
116 UTdbgout(__FILE__,__LINE__,os.str().c_str()); \
119 #define UT_DBGPRINTF(ZZ) printf ZZ
121 #define UT_DBG_CHECKMEMORY UTdebugCheckMemory()
122 #define UT_DBG_CHECKPOINTER(PTR) UTdebugCheckPointer(PTR)
124 #define UTdebugFormat(...) ((void)0)
125 #define UTdebugFormatCd(...) ((void)0)
126 #define UTdebugPrint(...) ((void)0)
127 #define UTdebugPrintCd(...) ((void)0)
128 #define UT_DBGOUT(ZZ) ((void)0)
129 #define UT_DBGOS(ZZ) ((void)0)
130 #define UT_DBGPRINTF(ZZ) ((void)0)
131 #define UT_DBG_CHECKMEMORY ((void)0)
132 #define UT_DBG_CHECKPOINTER(PTR) ((void)0)
OIIO_API string_view getenv(string_view name)
UT_API bool UTdebugCheckPointer(const void *ptr)
GLuint const GLchar * name
UT_API const char * UTconsoleColorString(const char *colorname)
UT_API void UTdbgout(const char *file, int lineno, const char *text)
UT_API int UTdebugCheckMemory()
UT_API int UTgetSESIlogFlag(int env_control)
UT_API int UTisSESImachine()