Initializing the Droplet library.
More...
These functions are used to initialize global data used by Droplet library.
Enumerator |
---|
DPL_DEBUG |
debug message (lowest)
|
DPL_INFO |
informational message
|
DPL_WARNING |
warning message
|
DPL_ERROR |
error message (highest)
|
Must be called once and only once after all Droplet library calls have stopped.
dpl_status_t dpl_init |
( |
void |
| ) |
|
Initializes global data used by the library. Must be called once and only once before any other Droplet library functions. The next step after calling dpl_init()
is probably dpl_ctx_new()
.
- Return values
-
DPL_SUCCESS | this function cannot currently fail |
Set a function that will be called to handle every log message emitted by the Droplet library. Passing NULL
for logfunc resets the Droplet library to using it's default internal logging which emits log messages to the process' stderr. The logfunc is called with a pre-formatted string representing a single line of log output with no newline. It is also passed a dpl_ctx_t*
which may be NULL or may point to a context associated with the error.
This function is not thread-safe. Do not call it while other threads are running Droplet library code. It is recommended you call the function just after calling dpl_init()
.
- Parameters
-
logfunc | the callback function or NULL for default behaviour |