Skip to content

Commit 6b867f2

Browse files
committed
Simple redirection to syslog.
1 parent d095cef commit 6b867f2

1 file changed

Lines changed: 8 additions & 18 deletions

File tree

gsoap/stdsoap2.h

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -960,6 +960,10 @@ extern intmax_t __strtoull(const char*, char**, int);
960960

961961
/* #define DEBUG_STAMP */ /* Uncomment to debug sending (in file SENT.log) receiving (in file RECV.log) and time-stamped operations (in file TEST.log) */
962962

963+
#ifdef DEBUG
964+
# include <syslog.h>
965+
#endif
966+
963967
#ifdef __cplusplus
964968
extern "C" {
965969
#endif
@@ -1908,7 +1912,8 @@ typedef unsigned short soap_ssl_flags;
19081912

19091913
#ifdef SOAP_DEBUG
19101914
# ifndef SOAP_MESSAGE
1911-
# define SOAP_MESSAGE fprintf
1915+
# define SOAP_MESSAGE(USELESS_FDEBUG, ...) \
1916+
syslog(LOG_NOTICE, ##__VA_ARGS__);
19121917
# endif
19131918
# ifndef DBGLOG
19141919
# ifdef DEBUG_STAMP
@@ -1947,28 +1952,13 @@ typedef unsigned short soap_ssl_flags;
19471952
# endif
19481953
# else
19491954
# define DBGLOG(DBGFILE, CMD) \
1950-
{ if (soap)\
1951-
{ if (!soap->fdebug[SOAP_INDEX_##DBGFILE])\
1952-
soap_open_logfile((struct soap*)soap, SOAP_INDEX_##DBGFILE);\
1953-
if (soap->fdebug[SOAP_INDEX_##DBGFILE])\
1954-
{ FILE *fdebug = soap->fdebug[SOAP_INDEX_##DBGFILE];\
1955-
CMD;\
1956-
fflush(fdebug);\
1957-
}\
1958-
}\
1955+
{ CMD;\
19591956
}
19601957
# endif
19611958
# endif
19621959
# ifndef DBGMSG
19631960
# define DBGMSG(DBGFILE, MSG, LEN) \
1964-
{ if (soap)\
1965-
{ if (!soap->fdebug[SOAP_INDEX_##DBGFILE])\
1966-
soap_open_logfile((struct soap*)soap, SOAP_INDEX_##DBGFILE);\
1967-
if (soap->fdebug[SOAP_INDEX_##DBGFILE])\
1968-
{ fwrite((void*)(MSG), 1, (size_t)(LEN), soap->fdebug[SOAP_INDEX_##DBGFILE]);\
1969-
fflush(soap->fdebug[SOAP_INDEX_##DBGFILE]);\
1970-
}\
1971-
}\
1961+
{ syslog(LOG_NOTICE, "%s", MSG); \
19721962
}
19731963
# endif
19741964
# ifndef DBGFUN

0 commit comments

Comments
 (0)