![]() |
Home | Documentation |
Debugging and logging
updated Fri Jan 17 2025 by Robert van Engelen
|
This module defines compile-time flags and functions for run-time debugging and logging. More...
Macros | |
#define | DEBUG |
User-definable macro to enable debugging and logging. | |
#define | SOAP_DEBUG |
User-definable macro, identical behavior as #DEBUG but more portable. | |
#define | DEBUG_STAMP |
User-definable macro to enable debugging and logging with time stamps. | |
#define | SOAP_MEM_DEBUG |
User-definable macro to enable memory debugging without logging. |
Functions | |
void | soap_set_recv_logfile (struct soap *soap, const char *logfile) |
Specify a file name to save messages received. | |
void | soap_set_sent_logfile (struct soap *soap, const char *logfile) |
Specify a file name to save messages sent. | |
void | soap_set_test_logfile (struct soap *soap, const char *logfile) |
Specify a file name to save debugging info. | |
void | soap_set_logging_inbound (struct soap *soap, FILE *fd) |
Specify inbound message logging with the logging plugin. | |
void | soap_set_logging_outbound (struct soap *soap, FILE *fd) |
Specify outbound message logging with the logging plugin. | |
void | soap_logging_stats (struct soap *soap, size_t *sent, size_t *recv) |
Collect messaging statistics with the logging plugin. | |
void | soap_reset_logging_stats (struct soap *soap) |
Reset messaging statistics with the logging plugin. | |
int | logging (struct soap *, struct soap_plugin *, void *) |
The logging plugin registration function. |
This module defines compile-time flags and functions for run-time debugging and logging.
This module defines the following compile-time flags and functions to specify log files:
Alternatively, the logging plugin can be used without setting #DEBUG to efficiently log messages and collect statistics:
#define DEBUG |
User-definable macro to enable debugging and logging.
When this macro is defined at compile time (undefined by default), the engine runs in debug mode to produce RECV.log, SENT.log, and TEST.log files for debugging purposes:
c++ -D DEBUG -o client stdsoap2.cpp soapC.cpp soapClient.cpp client.cpp ./client ls *.log RECV.log SENT.log TEST.log
#define DEBUG_STAMP |
User-definable macro to enable debugging and logging with time stamps.
When this macro is defined at compile time (undefined by default), the engine runs in debug mode to produce RECV.log, SENT.log, and TEST.log files with time stamps for debugging purposes:
c++ -D DEBUG_STAMP -o client stdsoap2.cpp soapC.cpp soapClient.cpp client.cpp ./client ls *.log RECV.log SENT.log TEST.log
#define SOAP_DEBUG |
User-definable macro, identical behavior as #DEBUG but more portable.
This macro should be used when the #DEBUG macro is reserved by the IDE for other purposes.
#define SOAP_MEM_DEBUG |
User-definable macro to enable memory debugging without logging.
When this macro is defined at compile time (undefined by default), the engine runs in debug mode to detect memory corruption errors but does not produce RECV.log, SENT.log and TEST.log files and avoids the significant run-time overhead of logging. Use this macro when memory debugging is required without logging overhead.
c++ -D SOAP_MEM_DEBUG -o client stdsoap2.cpp soapC.cpp soapClient.cpp client.cpp ./client ls *.log ls: No match.
int logging | ( | struct soap * | , |
struct soap_plugin * | , | ||
void * | ) |
The logging plugin registration function.
The logging plugin API is declared and defined in gsoap/plugin/logging.h and gsoap/plugin/logging.c.
void soap_logging_stats | ( | struct soap * | soap, |
size_t * | sent, | ||
size_t * | recv ) |
Collect messaging statistics with the logging plugin.
This function collects the recorded messaging statistics, namely the number of bytes received from inbound messages and the number of bytes sent to outbound messages.
soap | soap context |
sent | pointer to variable to assign |
recv | pointer to variable to assign |
void soap_reset_logging_stats | ( | struct soap * | soap | ) |
void soap_set_logging_inbound | ( | struct soap * | soap, |
FILE * | fd ) |
Specify inbound message logging with the logging plugin.
This function enables inbound message logging. Inbound messages are recorded to the specified file descriptor. Logging is disabled by passing a NULL file descriptor parameter.
soap | soap context |
fd | file descriptor to record inbound messages |
void soap_set_logging_outbound | ( | struct soap * | soap, |
FILE * | fd ) |
Specify outbound message logging with the logging plugin.
This function enables outbound message logging. Outbound messages are recorded to the specified file descriptor. Logging is disabled by passing a NULL file descriptor parameter.
soap | soap context |
fd | file descriptor to record outbound messages |
void soap_set_recv_logfile | ( | struct soap * | soap, |
const char * | logfile ) |
Specify a file name to save messages received.
This function sets the specified file path name logfile to save all messages received. Messages are appended to the specified file. Disables logging when logfile is NULL. This function requires compilation with #DEBUG.
soap | soap context |
logfile | path name of the log file or NULL to disable logging |
void soap_set_sent_logfile | ( | struct soap * | soap, |
const char * | logfile ) |
Specify a file name to save messages sent.
This function sets the specified file path name logfile to save the messages sent. Messages are appended to the specified file. Disables logging when logfile is NULL. This function requires compilation with #DEBUG.
soap | soap context |
logfile | path name of the log file or NULL to disable logging |
void soap_set_test_logfile | ( | struct soap * | soap, |
const char * | logfile ) |
Specify a file name to save debugging info.
This function sets the specified file path name logfile to save debugging info generated by the engine and by the generated code. Disables logging when logfile is NULL. This function requires compilation with #DEBUG.
soap | soap context |
logfile | path name of the log file or NULL to disable logging |