Home | Documentation |
Debugging and logging
updated Tue Aug 27 2024 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. More... | |
#define | SOAP_DEBUG |
User-definable macro, identical behavior as DEBUG but more portable. More... | |
#define | DEBUG_STAMP |
User-definable macro to enable debugging and logging with time stamps. More... | |
#define | SOAP_MEM_DEBUG |
User-definable macro to enable memory debugging without logging. More... | |
Functions | |
void | soap_set_recv_logfile (struct soap *soap, const char *logfile) |
Specify a file name to save messages received. More... | |
void | soap_set_sent_logfile (struct soap *soap, const char *logfile) |
Specify a file name to save messages sent. More... | |
void | soap_set_test_logfile (struct soap *soap, const char *logfile) |
Specify a file name to save debugging info. More... | |
void | soap_set_logging_inbound (struct soap *soap, FILE *fd) |
Specify inbound message logging with the logging plugin. More... | |
void | soap_set_logging_outbound (struct soap *soap, FILE *fd) |
Specify outbound message logging with the logging plugin. More... | |
void | soap_logging_stats (struct soap *soap, size_t *sent, size_t *recv) |
Collect messaging statistics with the logging plugin. More... | |
void | soap_reset_logging_stats (struct soap *soap) |
Reset messaging statistics with the logging plugin. More... | |
int | logging (struct soap *, struct soap_plugin *, void *) |
The logging plugin registration function. More... | |
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:
DEBUG
SOAP_DEBUG
DEBUG_STAMP
SOAP_MEM_DEBUG
soap_set_recv_logfile
soap_set_sent_logfile
soap_set_test_logfile
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:
RECV.log
contains messages received, concatenatedSENT.log
contains messages sent, concatenatedTEST.log
contains debugging information to identify issues Debugging with DEBUG
incurs significant run-time overhead and should only be used 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
SOAP_DEBUG
, DEBUG_STAMP
, SOAP_MEM_DEBUG
, soap_set_recv_logfile
, soap_set_sent_logfile
, soap_set_test_logfile
and the message logging plugin gsoap/plugin/logging.c
as a faster alternative.DEBUG
, because these libraries are built by default without debugging enabled. Use ./configure --enable-debug
to rebuild the libraries with -D DEBUG
. #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:
RECV.log
contains messages received, concatenatedSENT.log
contains messages sent, concatenatedTEST.log
contains debugging information with time stamps to identify issues This incurs significant run-time overhead and should only be used 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
DEBUG
, SOAP_DEBUG
, SOAP_MEM_DEBUG
, soap_set_recv_logfile
, soap_set_sent_logfile
, soap_set_test_logfile
and the message logging plugin gsoap/plugin/logging.c
as a faster alternative.DEBUG_STAMP
, because these libraries are built by default without debugging enabled. #define SOAP_DEBUG |
#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.
DEBUG
, SOAP_DEBUG
, DEBUG_STAMP
.SOAP_MEM_DEBUG
, because these libraries are built by default without debugging enabled. 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.
gsoap/plugin/logging.h
and gsoap/plugin/logging.c
and requires the logging
plugin and does not require DEBUG
.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.
gsoap/plugin/logging.h
and gsoap/plugin/logging.c
and requires the logging
plugin and does not require DEBUG
.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.
gsoap/plugin/logging.h
and gsoap/plugin/logging.c
and requires the logging
plugin and does not require DEBUG
.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
.
DEBUG
.soap_set_sent_logfile
and the message logging plugin gsoap/plugin/logging.c
as a faster alternative. 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
.
DEBUG
.soap_set_recv_logfile
and the message logging plugin gsoap/plugin/logging.c
as a faster alternative. 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
.
DEBUG
. soap | soap context |
logfile | path name of the log file or NULL to disable logging |