diff include/freeDiameter/libfdproto.h @ 784:e87d083d0342

Added ability to register another log function; thanks to Zack for the code
author Sebastien Decugis <sdecugis@nict.go.jp>
date Thu, 29 Mar 2012 21:19:33 +0200
parents 003df4a9ade2
children cb84f5be889d
line wrap: on
line diff
--- a/include/freeDiameter/libfdproto.h	Fri Mar 02 08:13:34 2012 +0100
+++ b/include/freeDiameter/libfdproto.h	Thu Mar 29 21:19:33 2012 +0200
@@ -154,6 +154,37 @@
  */
 char * fd_log_time ( struct timespec * ts, char * buf, size_t len );
 
+/*
+ * FUNCTION:    fd_log_handler_register
+ * MACRO:
+ *
+ * PARAMETERS:
+ *  fstr        : Stream where the text will be sent (default: stdout)
+ *  format      : Same format string as in the printf function
+ *  va_list     : Argument list
+ *
+ * DESCRIPTION:
+ * Register an external method for logging purposes.
+ *
+ * RETURN VALUE:
+ * int          : Success or failure
+ */
+int fd_log_handler_register ( void (*logger)(const char * format, va_list *args) );
+
+/*
+ * FUNCTION:    fd_log_handler_unregister
+ * MACRO:
+ *
+ * PARAMETERS:
+ *
+ * DESCRIPTION:
+ * Unregister the external logging function.
+ *
+ * RETURN VALUE:
+ * int          : Success or failure
+ */
+int fd_log_handler_unregister ( void );
+
 
 /*============================================================*/
 /*                    DEBUG MACROS                            */
"Welcome to our mercurial repository"