]> begriffs open source - freertos/blob - FreeRTOS-Plus/Source/WolfSSL/wolfssl/wolfcrypt/logging.h
Update WolfSSL library to the latest version.
[freertos] / FreeRTOS-Plus / Source / WolfSSL / wolfssl / wolfcrypt / logging.h
1 /* logging.h
2  *
3  * Copyright (C) 2006-2015 wolfSSL Inc.
4  *
5  * This file is part of wolfSSL. (formerly known as CyaSSL)
6  *
7  * wolfSSL is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * wolfSSL is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
20  */
21
22 /* submitted by eof */
23
24
25 #ifndef WOLFSSL_LOGGING_H
26 #define WOLFSSL_LOGGING_H
27
28 #include <wolfssl/wolfcrypt/types.h>
29
30 #ifdef __cplusplus
31     extern "C" {
32 #endif
33
34
35 enum  CYA_Log_Levels {
36     ERROR_LOG = 0,
37     INFO_LOG,
38     ENTER_LOG,
39     LEAVE_LOG,
40     OTHER_LOG
41 };
42
43 typedef void (*wolfSSL_Logging_cb)(const int logLevel,
44                                   const char *const logMessage);
45
46 WOLFSSL_API int wolfSSL_SetLoggingCb(wolfSSL_Logging_cb log_function);
47
48 #ifdef DEBUG_WOLFSSL
49
50     void WOLFSSL_ENTER(const char* msg);
51     void WOLFSSL_LEAVE(const char* msg, int ret);
52
53     void WOLFSSL_ERROR(int);
54     void WOLFSSL_MSG(const char* msg);
55
56 #else /* DEBUG_WOLFSSL   */
57
58     #define WOLFSSL_ENTER(m)
59     #define WOLFSSL_LEAVE(m, r)
60
61     #define WOLFSSL_ERROR(e)
62     #define WOLFSSL_MSG(m)
63
64 #endif /* DEBUG_WOLFSSL  */
65
66 #ifdef __cplusplus
67 }
68 #endif
69 #endif /* WOLFSSL_LOGGING_H */
70