18struct AtParamValueMap;
27#if !defined(__AI_FILE__)
28#define __AI_FILE__ __FILE__
30#if !defined(__AI_LINE__)
31#define __AI_LINE__ __LINE__
33#if !defined(__AI_FUNCTION__)
34#define __AI_FUNCTION__ __FUNCTION__
41#define AI_SEVERITY_INFO 0x00
42#define AI_SEVERITY_WARNING 0x01
43#define AI_SEVERITY_ERROR 0x02
44#define AI_SEVERITY_FATAL 0x03
51#define AI_LOG_NONE 0x0000
52#define AI_LOG_INFO 0x0001
53#define AI_LOG_WARNINGS 0x0002
54#define AI_LOG_ERRORS 0x0004
55#define AI_LOG_DEBUG 0x0008
56#define AI_LOG_STATS 0x0010
57#define AI_LOG_ASS_PARSE 0x0020
58#define AI_LOG_PLUGINS 0x0040
59#define AI_LOG_PROGRESS 0x0080
60#define AI_LOG_NAN 0x0100
61#define AI_LOG_TIMESTAMP 0x0200
62#define AI_LOG_BACKTRACE 0x0400
63#define AI_LOG_MEMORY 0x0800
64#define AI_LOG_COLOR 0x1000
65#define AI_LOG_STATUS 0x2000
70 ( AI_LOG_INFO | AI_LOG_WARNINGS | AI_LOG_ERRORS | \
71 AI_LOG_DEBUG | AI_LOG_STATS | AI_LOG_PLUGINS | \
72 AI_LOG_PROGRESS | AI_LOG_NAN | AI_LOG_ASS_PARSE | \
73 AI_LOG_TIMESTAMP | AI_LOG_BACKTRACE | AI_LOG_MEMORY | \
86# define AI_PRINTF_ARGS(fmtarg_pos, vararg_pos) __attribute__ ((format (printf, fmtarg_pos, vararg_pos) ))
88# define AI_PRINTF_ARGS(fmtarg_pos, vararg_pos)
93typedef void (*
AtMsgCallBack)(
int logmask,
int severity,
const char* msg_string,
int tabs);
104typedef void (*
AtMsgExtendedCallBack)(
int logmask,
int severity,
const char* msg_string, AtParamValueMap* metadata,
void* user_ptr);
121#ifdef AI_GPU_COMPILER
122# define AiMsgInfo(format, ...)
123# define AiMsgDebug(format, ...)
124# define AiMsgWarning(format, ...)
125# define AiMsgError(format, ...)
126# define AiMsgFatal(format, ...)
128AI_API
void AiMsgInfo(
const char* format, ...) AI_PRINTF_ARGS(1,2);
129AI_API
void AiMsgDebug(const
char* format, ...) AI_PRINTF_ARGS(1,2);
130AI_API
void AiMsgWarning(const
char* format, ...) AI_PRINTF_ARGS(1,2);
131AI_API
void AiMsgError(const
char* format, ...) AI_PRINTF_ARGS(1,2);
132AI_API
void AiMsgFatal(const
char* format, ...) AI_PRINTF_ARGS(1,2);
DLL export prefix for API functions (necessary for multi-platform development)
AI_API void AiMsgDeregisterCallback(unsigned int callback_id)
Remove a previously registered logging callback function.
Definition: ai_msg.cpp:210
AI_API void AiMsgWarning(const char *format,...)
Send a warning message to the log.
Definition: ai_msg.cpp:292
void(* AtMsgCallBack)(int logmask, int severity, const char *msg_string, int tabs)
Custom message callback, as passed to AiMsgSetCallback()
Definition: ai_msg.h:93
void(* AtMsgExtendedCallBack)(int logmask, int severity, const char *msg_string, AtParamValueMap *metadata, void *user_ptr)
Custom message callback, as passed to AiMsgRegisterCallback()
Definition: ai_msg.h:104
AI_API void AiMsgSystemInfo(const AtUniverse *universe)
Output system information to the log.
Definition: ai_msg.cpp:410
AI_API uint32_t AiMsgUtilGetElapsedTime()
Elapsed time since AiBegin()
Definition: ai_msg.cpp:395
AI_API void AiMsgDebug(const char *format,...)
Send a debug message to the log.
Definition: ai_msg.cpp:269
AI_API unsigned int AiMsgRegisterCallback(AtMsgExtendedCallBack func, int mask, void *user_ptr)
Add an additional logging callback function.
Definition: ai_msg.cpp:199
AI_API void AiMsgError(const char *format,...)
Send an error message to the log.
Definition: ai_msg.cpp:322
AI_API int AiMsgGetCallbackMask(unsigned int callback_id)
Returns the mask of a previously registered logging callback function.
Definition: ai_msg.cpp:235
AI_API AI_DEPRECATED void AiMsgResetCallback()
Reset the logging callback function to its default value.
Definition: ai_msg.cpp:182
AI_API void AiMsgSetConsoleFlags(const AtUniverse *universe, int flags)
Set the mask for what types of messages from the specified universe can be written to stdout.
Definition: ai_msg.cpp:78
AI_API void AiMsgInfo(const char *format,...)
Send an information message to the log.
Definition: ai_msg.cpp:250
AI_API void AiMsgSetCallbackMask(unsigned int callback_id, int mask)
Sets the mask of a previously registered logging callback function.
Definition: ai_msg.cpp:223
AI_API int AiMsgGetLogFileFlags(const AtUniverse *universe)
Get the type of messages that will be written to the log file for a given universe.
Definition: ai_msg.cpp:97
AI_API void AiMsgSetLogFileFlags(const AtUniverse *universe, int flags)
Set the mask for what types of messages from the specified universe can be written to the log file.
Definition: ai_msg.cpp:57
AI_API AI_DEPRECATED void AiMsgSetCallback(AtMsgCallBack func)
Change the logging callback function.
Definition: ai_msg.cpp:152
AI_API void AiMsgFatal(const char *format,...)
Send a fatal error message to the log.
Definition: ai_msg.cpp:353
AI_API AI_DEPRECATED void AiMsgAddCallback(AtMsgCallBack func)
Add an additional logging callback function.
Definition: ai_msg.cpp:168
AI_API void AiMsgTab(int tabinc)
Change the indentation of subsequent log messages.
Definition: ai_msg.cpp:374
AI_API void AiMsgSetMaxWarnings(int max_warnings)
Set the maximum number of reported warnings.
Definition: ai_msg.cpp:133
AI_API size_t AiMsgUtilGetUsedMemory()
Memory used by this process in bytes.
Definition: ai_msg.cpp:384
AI_API int AiMsgGetConsoleFlags(const AtUniverse *universe)
Get the type of messages that will be written to the stdout for a given universe.
Definition: ai_msg.cpp:116
AI_API void AiMsgSetLogFileName(const char *filename)
Enable writing messages to the specified log file.
Definition: ai_msg.cpp:30
This represents a universe in Arnold.