#ifndef angel_logging_h
#define angel_logging_h
#include <stdarg.h>
extern void __rt_warning(char *format, ...);
extern void __rt_error(char *format, ...);
typedef enum WarnLevel {
WL_TRACE,
WL_WARN,
WL_ERROR
} WarnLevel;
void va_warn(WarnLevel level, char *format, va_list args);
#ifdef _WINGDI_
# undef ERROR
#endif
#ifndef ERROR
# define ERROR_FORMAT "Error \"%s\" in %s at line %d\n"
# define ERROR(e) __rt_error(ERROR_FORMAT, (e), __FILE__, __LINE__)
#endif
#ifndef ASSERT
# ifdef ASSERTIONS_ENABLED
# define ASSERT(x, y) ((x) ? (void)(0) : ERROR((y)))
# else
# define ASSERT(x, y) ((void)(0))
# endif
#endif
#ifndef WARN
# ifdef ASSERTIONS_ENABLED
# define WARN_FORMAT "Warning \"%s\" in %s at line %d\n"
# define WARN(w) __rt_warning(WARN_FORMAT, (w), __FILE__, __LINE__)
# else
# define WARN(w) ((void)(0))
# endif
#endif
#ifdef NO_INFO_MESSAGES
# define __rt_info (void)
# ifndef INFO
# define INFO(w)
# endif
#else
# define __rt_info __rt_warning
# ifndef INFO
# ifdef DEBUG
# define INFO(w) __rt_warning("%s\n", (w))
# else
# define INFO(w) ((void)(0))
# endif
# endif
#endif
#if defined(DEBUG) && !defined(NO_IDLE_CHITCHAT)
# ifndef DO_TRACE
# define DO_TRACE (1)
# endif
#endif
#ifdef DO_TRACE
extern void __rt_trace(char *format, ...);
#endif
#ifndef TRACE
# ifdef DO_TRACE
# define TRACE(w) __rt_trace("%s ", (w))
# else
# define TRACE(w) ((void)(0))
# endif
#endif
#endif