File: logging.h

package info (click to toggle)
wolfssl 5.8.4-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 117,604 kB
  • sloc: ansic: 1,584,954; asm: 481,206; sh: 11,586; cs: 6,596; xml: 3,878; perl: 3,291; makefile: 2,058; ada: 1,891; javascript: 748; python: 636; cpp: 131; ruby: 118; objc: 80; tcl: 73
file content (78 lines) | stat: -rw-r--r-- 2,044 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*!
    \ingroup Logging

    \brief This function registers a logging callback that will be used to
    handle the wolfSSL log message. By default, if the system supports it
    fprintf() to stderr is used but by using this function anything
    can be done by the user.

    \return Success If successful this function will return 0.
    \return BAD_FUNC_ARG is the error that will be returned if a function
    pointer is not provided.

    \param log_function function to register as a logging callback.
    Function signature must follow the above prototype.

    _Example_
    \code
    int ret = 0;
    // Logging callback prototype
    void MyLoggingCallback(const int logLevel, const char* const logMessage);
    // Register the custom logging callback with wolfSSL
    ret = wolfSSL_SetLoggingCb(MyLoggingCallback);
    if (ret != 0) {
	    // failed to set logging callback
    }
    void MyLoggingCallback(const int logLevel, const char* const logMessage)
    {
	// custom logging function
    }
    \endcode

    \sa wolfSSL_Debugging_ON
    \sa wolfSSL_Debugging_OFF
*/
int wolfSSL_SetLoggingCb(wolfSSL_Logging_cb log_function);

/*!
    \ingroup Debug

    \brief If logging has been enabled at build time this function turns on
    logging at runtime.  To enable logging at build time use --enable-debug
    or define DEBUG_WOLFSSL.

    \return 0 upon success.
    \return NOT_COMPILED_IN is the error that will be returned if logging
    isn’t enabled for this build.

    \param none No parameters.

    _Example_
    \code
    wolfSSL_Debugging_ON();
    \endcode

    \sa wolfSSL_Debugging_OFF
    \sa wolfSSL_SetLoggingCb
*/
int  wolfSSL_Debugging_ON(void);

/*!
    \ingroup Debug

    \brief This function turns off runtime logging messages.  If they’re
    already off, no action is taken.

    \return none No returns.

    \param none No parameters.

    _Example_
    \code
    wolfSSL_Debugging_OFF();
    \endcode

    \sa wolfSSL_Debugging_ON
    \sa wolfSSL_SetLoggingCb
*/
void wolfSSL_Debugging_OFF(void);