Skip to content

Commit

Permalink
api: errorhandler.h remove deprecated old printf style methods
Browse files Browse the repository at this point in the history
Signed-off-by: Larry Gritz <[email protected]>
  • Loading branch information
lgritz committed Jul 11, 2024
1 parent a96e10c commit eb40572
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 125 deletions.
1 change: 0 additions & 1 deletion src/doc/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -2194,7 +2194,6 @@ PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS \
OIIO_NODISCARD:= \
OIIO_DEPRECATED:=[[deprecated]] \
OIIO_FORMAT_DEPRECATED:= \
OIIO_ERRORHANDLER_PRINTF_DEPRECATED:= \
OIIO_FORCEINLINE=inline \
IMATH_HALF_H_=1 \
INCLUDED_IMATHVEC_H=1 \
Expand Down
124 changes: 0 additions & 124 deletions src/include/OpenImageIO/errorhandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,6 @@
#include <OpenImageIO/strutil.h>


// If OIIO_ERRORHANDLER_HIDE_PRINTF is defined, mark the old-style printf-like
// format functions as deprecated. (This is a debugging aid for downstream
// projects who want to root out any places where they might be using the old
// one).
#if defined(OIIO_ERRORHANDLER_HIDE_PRINTF) || defined(OIIO_INTERNAL)
# define OIIO_ERRORHANDLER_PRINTF_DEPRECATED \
OIIO_DEPRECATED( \
"old style (printf-like) formatting version of this function is deprecated")
#else
# define OIIO_ERRORHANDLER_PRINTF_DEPRECATED
#endif


OIIO_NAMESPACE_BEGIN

/// ErrorHandler is a simple class that accepts error messages
Expand Down Expand Up @@ -94,117 +81,6 @@ class OIIO_UTIL_API ErrorHandler {
void debug(const std::string&) {}
#endif

// Formatted output with the same notation as Strutil::format.
/// Use with caution! Some day this will change to be fmt-like rather
/// than printf-like.
template<typename... Args>
OIIO_FORMAT_DEPRECATED void info(const char* format, const Args&... args)
{
if (verbosity() >= VERBOSE)
info(Strutil::format(format, args...));
}

/// Warning message with printf-like formatted error message.
/// Will not print unless verbosity >= NORMAL (i.e. will suppress
/// for QUIET).
template<typename... Args>
OIIO_FORMAT_DEPRECATED void warning(const char* format, const Args&... args)
{
if (verbosity() >= NORMAL)
warning(Strutil::format(format, args...));
}

/// Error message with printf-like formatted error message.
/// Will print regardless of verbosity.
template<typename... Args>
OIIO_FORMAT_DEPRECATED void error(const char* format, const Args&... args)
{
error(Strutil::format(format, args...));
}

/// Severe error message with printf-like formatted error message.
/// Will print regardless of verbosity.
template<typename... Args>
OIIO_FORMAT_DEPRECATED void severe(const char* format, const Args&... args)
{
severe(Strutil::format(format, args...));
}

/// Prefix-less message with printf-like formatted error message.
/// Will not print if verbosity is QUIET. Also note that unlike
/// the other routines, message() will NOT append a newline.
template<typename... Args>
OIIO_FORMAT_DEPRECATED void message(const char* format, const Args&... args)
{
if (verbosity() > QUIET)
message(Strutil::format(format, args...));
}

/// Debugging message with printf-like formatted error message.
/// This will not produce any output if not in DEBUG mode, or
/// if verbosity is QUIET.
template<typename... Args>
OIIO_FORMAT_DEPRECATED void debug(const char* format OIIO_MAYBE_UNUSED,
const Args&... args OIIO_MAYBE_UNUSED)
{
#ifndef NDEBUG
debug(Strutil::format(format, args...));
#endif
}

//
// Formatted output with printf notation. Use these if you specifically
// want printf-notation, even after format() changes to python notation
// in some future OIIO release.
//
template<typename... Args>
OIIO_ERRORHANDLER_PRINTF_DEPRECATED void infof(const char* format,
const Args&... args)
{
if (verbosity() >= VERBOSE)
info(Strutil::sprintf(format, args...));
}

template<typename... Args>
OIIO_ERRORHANDLER_PRINTF_DEPRECATED void warningf(const char* format,
const Args&... args)
{
if (verbosity() >= NORMAL)
warning(Strutil::sprintf(format, args...));
}

template<typename... Args>
OIIO_ERRORHANDLER_PRINTF_DEPRECATED void errorf(const char* format,
const Args&... args)
{
error(Strutil::sprintf(format, args...));
}

template<typename... Args>
OIIO_ERRORHANDLER_PRINTF_DEPRECATED void severef(const char* format,
const Args&... args)
{
severe(Strutil::sprintf(format, args...));
}

template<typename... Args>
OIIO_ERRORHANDLER_PRINTF_DEPRECATED void messagef(const char* format,
const Args&... args)
{
if (verbosity() > QUIET)
message(Strutil::sprintf(format, args...));
}

template<typename... Args>
OIIO_ERRORHANDLER_PRINTF_DEPRECATED void
debugf(const char* format OIIO_MAYBE_UNUSED,
const Args&... args OIIO_MAYBE_UNUSED)
{
#ifndef NDEBUG
debug(Strutil::sprintf(format, args...));
#endif
}

//
// Formatted output with std::format notation. Use these if you
// specifically want std::format-notation, even before format() changes
Expand Down

0 comments on commit eb40572

Please sign in to comment.