Grid Community Toolkit  6.2.1629922860 (tag: v6.2.20210826)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
globus_ftp_client_debug_plugin.example

The following example illustrates a typical use of the debug plugin. In this case, we configure a plugin instance to output log messages preceded by the process name and pid to a file named gridftp.log.

int main(int argc, char *argv[])
{
FILE * log;
char text[256];
/* Activate the necessary modules */
/* Configure plugin to show custom text, and send plugin data to
* a custom log file
*/
log = fopen("gridftp.log", "a");
sprintf(text, "%s:%ld", argv[0], (long) getpid());
globus_ftp_client_debug_plugin_init(&debug_plugin, log, text);
/* Set up our client handle to use the new plugin */
globus_ftp_client_handleattr_add_plugin(&handleattr, &debug_plugin);
globus_ftp_client_handle_init(&handle, &handleattr);
/* As this get is processed, data will be appended to our gridftp.log
* file
*/
"ftp://ftp.globus.org/pub/globus/README",
callback_fn,
}