/*!
\brief A method akin to printf that allows you to redirect output to a specific console "channel"
*/
-SWITCH_DECLARE(void) switch_console_printf(switch_text_channel_t channel, char *file, const char *func, int line, char *fmt, ...);
+SWITCH_DECLARE(void) switch_console_printf(switch_text_channel_t channel, char *file, const char *func, int line, char *fmt, ...) PRINTF_FUNCTION(5,6);
/*!
\brief A method akin to printf for dealing with api streams
*/
-SWITCH_DECLARE(switch_status_t) switch_console_stream_write(switch_stream_handle_t *handle, char *fmt, ...);
+SWITCH_DECLARE(switch_status_t) switch_console_stream_write(switch_stream_handle_t *handle, char *fmt, ...) PRINTF_FUNCTION(2,3);
SWITCH_END_EXTERN_C
#endif
\param fmt the value of the header (varargs see standard sprintf family)
\return SWITCH_STATUS_SUCCESS if the header was added
*/
-SWITCH_DECLARE(switch_status_t) switch_event_add_header(switch_event_t *event, switch_stack_t stack, char *header_name, char *fmt, ...);
+SWITCH_DECLARE(switch_status_t) switch_event_add_header(switch_event_t *event, switch_stack_t stack, char *header_name, char *fmt, ...) PRINTF_FUNCTION(4,5);
/*!
\brief Destroy an event
\return the xml object if the operation was successful
\note the body supplied by this function will supersede an existing body the event may have
*/
-SWITCH_DECLARE(switch_xml_t) switch_event_xmlize(switch_event_t *event, char *fmt, ...);
+SWITCH_DECLARE(switch_xml_t) switch_event_xmlize(switch_event_t *event, char *fmt, ...) PRINTF_FUNCTION(2,3);
/*!
\brief Determine if the event system has been initilized
\return SWITCH_STATUS_SUCCESS if the body was added to the event
\note the body parameter can be shadowed by the switch_event_reserve_subclass_detailed function
*/
-SWITCH_DECLARE(switch_status_t) switch_event_add_body(switch_event_t *event, char *fmt, ...);
+SWITCH_DECLARE(switch_status_t) switch_event_add_body(switch_event_t *event, char *fmt, ...) PRINTF_FUNCTION(2,3);
/*!
\param ... variable args
\note there are channel macros to supply the first 4 parameters
*/
-SWITCH_DECLARE(void) switch_log_printf(switch_text_channel_t channel, const char *file, const char *func, int line, switch_log_level_t level, char *fmt, ...);
+SWITCH_DECLARE(void) switch_log_printf(switch_text_channel_t channel, const char *file, const char *func, int line, switch_log_level_t level, char *fmt, ...) PRINTF_FUNCTION(6,7);
/*!
\brief Shut down the logging engine
#define DoxyDefine(x)
#endif
+#if __GNUC__ >= 3
+#define PRINTF_FUNCTION(fmtstr,vars) __attribute__((format(printf,fmtstr,vars)))
+#else
+#define PRINTF_FUNCTION(fmtstr,vars)
+#endif
+
SWITCH_END_EXTERN_C
#endif