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);
78 #if UT_ASSERT_LEVEL > 0
80 #define UTdebugFormat(...) do { \
81 UT_WorkBuffer dbostr; \
82 dbostr.format(__VA_ARGS__); \
83 UTdbgout(__FILE__, __LINE__, dbostr.buffer()); \
86 #define UTdebugFormatCd(color, ...) do { \
87 UT_WorkBuffer dbostr, cdstr; \
88 dbostr.format(__VA_ARGS__); \
89 if (strcmp(#color, "none") == 0) \
92 cdstr.sprintf("%s%s%s", UTconsoleColorString(#color), dbostr.buffer(), UTconsoleColorString("none")); \
93 UTdbgout(__FILE__, __LINE__, cdstr.buffer()); \
96 #define UTdebugPrint(...) do { \
97 UT_WorkBuffer dbostr; \
98 dbostr.print(__VA_ARGS__); \
99 UTdbgout(__FILE__, __LINE__, dbostr.buffer()); \
102 #define UTdebugPrintCd(color, ...) do { \
103 UT_WorkBuffer dbostr, cdstr; \
104 dbostr.print(__VA_ARGS__); \
105 if (strcmp(#color, "none") == 0) \
108 cdstr.sprintf("%s%s%s", UTconsoleColorString(#color), dbostr.buffer(), UTconsoleColorString("none")); \
109 UTdbgout(__FILE__, __LINE__, cdstr.buffer()); \
112 #define UT_DBGOUT(ZZ) do { \
113 UT_WorkBuffer dbostr; \
114 dbostr.sprintf ZZ ; \
115 UTdbgout(__FILE__, __LINE__, dbostr.buffer()); \
118 #define UT_DBGOS(ZZ) do { \
119 std::stringstream os; \
121 UTdbgout(__FILE__,__LINE__,os.str().c_str()); \
124 #define UT_DBGPRINTF(ZZ) printf ZZ
126 #define UT_DBG_CHECKMEMORY UTdebugCheckMemory()
127 #define UT_DBG_CHECKPOINTER(PTR) UTdebugCheckPointer(PTR)
129 #define UTdebugFormat(...) ((void)0)
130 #define UTdebugFormatCd(...) ((void)0)
131 #define UTdebugPrint(...) ((void)0)
132 #define UTdebugPrintCd(...) ((void)0)
133 #define UT_DBGOUT(ZZ) ((void)0)
134 #define UT_DBGOS(ZZ) ((void)0)
135 #define UT_DBGPRINTF(ZZ) ((void)0)
136 #define UT_DBG_CHECKMEMORY ((void)0)
137 #define UT_DBG_CHECKPOINTER(PTR) ((void)0)
OIIO_API string_view getenv(string_view name)
UT_API bool UTdebugCheckPointer(const void *ptr)
UT_API const char * UTconsoleColorString(const char *colorname)
UT_API void UTdbgout(const char *file, int lineno, const char *text)
GLuint const GLchar * name
UT_API int UTdebugCheckMemory()
UT_API int UTgetSESIlogFlag(int env_control)
UT_API int UTisSESImachine()