1DC_CONTEXT_SET_LOGFUN... BSD Library Functions Manual DC_CONTEXT_SET_LOGFUN...
2

NAME

4     dc_context_set_logfunc — set the logging function for a dive computer
5     context
6

LIBRARY

8     library “libdivecomputer”
9

SYNOPSIS

11     #include <libdivecomputer/context.h>
12
13     typedef void
14     (*dc_logfunc_t)(dc_context_t *context, dc_loglevel_t loglevel,
15         const char *file, unsigned int line, const char *function,
16         const char *message, void *userdata);
17
18     dc_status_t
19     dc_context_set_logfunc(dc_context_t *context, dc_logfunc_t logfunc,
20         void *userdata);
21

DESCRIPTION

23     Set the logging function logfunc associated with a dive computer context.
24     The logging function is invoked with argument userdata when the log level
25     (see dc_context_set_loglevel(3)) has been exceeded.
26
27     The logfunc accepts the following values:
28
29     context
30             The context in which it was invoked.
31
32     loglevel
33             The level of the log message.
34
35     file    The source file where the message was raised.
36
37     line    The source line (from 1) where the message was raised.
38
39     function
40             The function that raised the log message.
41
42     message
43             The log message itself.
44
45     userdata
46             The pointer passed to dc_context_set_logfunc.
47

RETURN VALUES

49     Returns DC_STATUS_OK on setting the log level, DC_STATUS_INVALIDARGS if
50     context is NULL, or another error code on failure.
51

SEE ALSO

53     dc_context_new(3), dc_context_set_loglevel(3)
54

AUTHORS

56     The library “libdivecomputer” library was written by Jef Driesen,
57     jef@libdivecomputer.org.  The manpages were written by
58     Kristaps Dzonsons, kristaps@bsd.lv.
59
60BSD                             January 5, 2017                            BSD
Impressum