Commit 4e66afa1 authored by Lucas Russo's avatar Lucas Russo

libclient/bpm_client.*: add logfile parameter

Now, we can choose whether we want libclient
to output debug messages to any FILE stream
parent 381aaf5f
......@@ -42,8 +42,19 @@
/************************ Our API ***********************/
/********************************************************/
bpm_client_t *bpm_client_new (char *broker_endp, int verbose)
bpm_client_t *bpm_client_new (char *broker_endp, int verbose,
const char *log_file_name)
{
assert (broker_endp);
/* Set logfile available for all dev_mngr and dev_io instances.
* We accept NULL as a parameter, meaning to suppress all messages */
debug_set_log (log_file_name);
DBE_DEBUG (DBG_LIB_CLIENT | DBG_LVL_INFO, "[libclient] Spawing LIBCLIENT"
" with broker address %s, with logfile on %s ...\n", broker_endp,
(log_file_name == NULL) ? "NULL" : log_file_name);
bpm_client_t *self = zmalloc (sizeof *self);
ASSERT_ALLOC(self, err_self_alloc);
self->mdp_client = mdp_client_new (broker_endp, verbose);
......
......@@ -61,7 +61,8 @@ typedef struct _acq_trans_t acq_trans_t;
/* Create an instance of the BPM client. This must be called
* before any operation involving communicating with the BPM
* server. Return an instance of the bpm client */
bpm_client_t *bpm_client_new (char *broker_endp, int verbose);
bpm_client_t *bpm_client_new (char *broker_endp, int verbose,
const char *log_file_name);
/* Destroy an instance of the BPM client. This must be called
* after all operations involving the communication with the BPM
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment