|
10 | 10 | #include <OpenImageIO/strutil.h> |
11 | 11 |
|
12 | 12 |
|
13 | | -// If OIIO_ERRORHANDLER_HIDE_PRINTF is defined, mark the old-style printf-like |
14 | | -// format functions as deprecated. (This is a debugging aid for downstream |
15 | | -// projects who want to root out any places where they might be using the old |
16 | | -// one). |
17 | | -#if defined(OIIO_ERRORHANDLER_HIDE_PRINTF) || defined(OIIO_INTERNAL) |
18 | | -# define OIIO_ERRORHANDLER_PRINTF_DEPRECATED \ |
19 | | - OIIO_DEPRECATED( \ |
20 | | - "old style (printf-like) formatting version of this function is deprecated") |
21 | | -#else |
22 | | -# define OIIO_ERRORHANDLER_PRINTF_DEPRECATED |
23 | | -#endif |
24 | | - |
25 | | - |
26 | 13 | OIIO_NAMESPACE_BEGIN |
27 | 14 |
|
28 | 15 | /// ErrorHandler is a simple class that accepts error messages |
@@ -94,117 +81,6 @@ class OIIO_UTIL_API ErrorHandler { |
94 | 81 | void debug(const std::string&) {} |
95 | 82 | #endif |
96 | 83 |
|
97 | | - // Formatted output with the same notation as Strutil::format. |
98 | | - /// Use with caution! Some day this will change to be fmt-like rather |
99 | | - /// than printf-like. |
100 | | - template<typename... Args> |
101 | | - OIIO_FORMAT_DEPRECATED void info(const char* format, const Args&... args) |
102 | | - { |
103 | | - if (verbosity() >= VERBOSE) |
104 | | - info(Strutil::format(format, args...)); |
105 | | - } |
106 | | - |
107 | | - /// Warning message with printf-like formatted error message. |
108 | | - /// Will not print unless verbosity >= NORMAL (i.e. will suppress |
109 | | - /// for QUIET). |
110 | | - template<typename... Args> |
111 | | - OIIO_FORMAT_DEPRECATED void warning(const char* format, const Args&... args) |
112 | | - { |
113 | | - if (verbosity() >= NORMAL) |
114 | | - warning(Strutil::format(format, args...)); |
115 | | - } |
116 | | - |
117 | | - /// Error message with printf-like formatted error message. |
118 | | - /// Will print regardless of verbosity. |
119 | | - template<typename... Args> |
120 | | - OIIO_FORMAT_DEPRECATED void error(const char* format, const Args&... args) |
121 | | - { |
122 | | - error(Strutil::format(format, args...)); |
123 | | - } |
124 | | - |
125 | | - /// Severe error message with printf-like formatted error message. |
126 | | - /// Will print regardless of verbosity. |
127 | | - template<typename... Args> |
128 | | - OIIO_FORMAT_DEPRECATED void severe(const char* format, const Args&... args) |
129 | | - { |
130 | | - severe(Strutil::format(format, args...)); |
131 | | - } |
132 | | - |
133 | | - /// Prefix-less message with printf-like formatted error message. |
134 | | - /// Will not print if verbosity is QUIET. Also note that unlike |
135 | | - /// the other routines, message() will NOT append a newline. |
136 | | - template<typename... Args> |
137 | | - OIIO_FORMAT_DEPRECATED void message(const char* format, const Args&... args) |
138 | | - { |
139 | | - if (verbosity() > QUIET) |
140 | | - message(Strutil::format(format, args...)); |
141 | | - } |
142 | | - |
143 | | - /// Debugging message with printf-like formatted error message. |
144 | | - /// This will not produce any output if not in DEBUG mode, or |
145 | | - /// if verbosity is QUIET. |
146 | | - template<typename... Args> |
147 | | - OIIO_FORMAT_DEPRECATED void debug(const char* format OIIO_MAYBE_UNUSED, |
148 | | - const Args&... args OIIO_MAYBE_UNUSED) |
149 | | - { |
150 | | -#ifndef NDEBUG |
151 | | - debug(Strutil::format(format, args...)); |
152 | | -#endif |
153 | | - } |
154 | | - |
155 | | - // |
156 | | - // Formatted output with printf notation. Use these if you specifically |
157 | | - // want printf-notation, even after format() changes to python notation |
158 | | - // in some future OIIO release. |
159 | | - // |
160 | | - template<typename... Args> |
161 | | - OIIO_ERRORHANDLER_PRINTF_DEPRECATED void infof(const char* format, |
162 | | - const Args&... args) |
163 | | - { |
164 | | - if (verbosity() >= VERBOSE) |
165 | | - info(Strutil::sprintf(format, args...)); |
166 | | - } |
167 | | - |
168 | | - template<typename... Args> |
169 | | - OIIO_ERRORHANDLER_PRINTF_DEPRECATED void warningf(const char* format, |
170 | | - const Args&... args) |
171 | | - { |
172 | | - if (verbosity() >= NORMAL) |
173 | | - warning(Strutil::sprintf(format, args...)); |
174 | | - } |
175 | | - |
176 | | - template<typename... Args> |
177 | | - OIIO_ERRORHANDLER_PRINTF_DEPRECATED void errorf(const char* format, |
178 | | - const Args&... args) |
179 | | - { |
180 | | - error(Strutil::sprintf(format, args...)); |
181 | | - } |
182 | | - |
183 | | - template<typename... Args> |
184 | | - OIIO_ERRORHANDLER_PRINTF_DEPRECATED void severef(const char* format, |
185 | | - const Args&... args) |
186 | | - { |
187 | | - severe(Strutil::sprintf(format, args...)); |
188 | | - } |
189 | | - |
190 | | - template<typename... Args> |
191 | | - OIIO_ERRORHANDLER_PRINTF_DEPRECATED void messagef(const char* format, |
192 | | - const Args&... args) |
193 | | - { |
194 | | - if (verbosity() > QUIET) |
195 | | - message(Strutil::sprintf(format, args...)); |
196 | | - } |
197 | | - |
198 | | - template<typename... Args> |
199 | | - OIIO_ERRORHANDLER_PRINTF_DEPRECATED void |
200 | | - debugf(const char* format OIIO_MAYBE_UNUSED, |
201 | | - const Args&... args OIIO_MAYBE_UNUSED) |
202 | | - { |
203 | | -#ifndef NDEBUG |
204 | | - debug(Strutil::sprintf(format, args...)); |
205 | | -#endif |
206 | | - } |
207 | | - |
208 | 84 | // |
209 | 85 | // Formatted output with std::format notation. Use these if you |
210 | 86 | // specifically want std::format-notation, even before format() changes |
|
0 commit comments