2011-08-25 23:41:19 +04:00
|
|
|
/* logging.h
|
2011-04-16 03:43:00 +04:00
|
|
|
*
|
2013-02-06 00:44:17 +04:00
|
|
|
* Copyright (C) 2006-2013 wolfSSL Inc.
|
2011-04-16 03:43:00 +04:00
|
|
|
*
|
|
|
|
* This file is part of CyaSSL.
|
|
|
|
*
|
|
|
|
* CyaSSL is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* CyaSSL is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
|
|
|
*/
|
|
|
|
|
2011-04-16 03:48:13 +04:00
|
|
|
/* submitted by eof */
|
|
|
|
|
2011-08-05 02:42:55 +04:00
|
|
|
|
2011-04-16 01:55:07 +04:00
|
|
|
#ifndef CYASSL_LOGGING_H
|
|
|
|
#define CYASSL_LOGGING_H
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
enum CYA_Log_Levels {
|
|
|
|
ERROR_LOG = 0,
|
|
|
|
INFO_LOG,
|
2011-04-16 03:43:00 +04:00
|
|
|
ENTER_LOG,
|
|
|
|
LEAVE_LOG,
|
|
|
|
OTHER_LOG
|
2011-04-16 01:55:07 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef void (*CyaSSL_Logging_cb)(const int logLevel,
|
|
|
|
const char *const logMessage);
|
|
|
|
|
2011-04-27 02:41:16 +04:00
|
|
|
CYASSL_API int CyaSSL_SetLoggingCb(CyaSSL_Logging_cb log_function);
|
2011-04-16 01:55:07 +04:00
|
|
|
|
|
|
|
|
|
|
|
#ifdef DEBUG_CYASSL
|
|
|
|
|
|
|
|
void CYASSL_ENTER(const char* msg);
|
|
|
|
void CYASSL_LEAVE(const char* msg, int ret);
|
|
|
|
|
|
|
|
void CYASSL_ERROR(int);
|
|
|
|
void CYASSL_MSG(const char* msg);
|
|
|
|
|
|
|
|
#else /* DEBUG_CYASSL */
|
|
|
|
|
|
|
|
#define CYASSL_ENTER(m)
|
|
|
|
#define CYASSL_LEAVE(m, r)
|
|
|
|
|
|
|
|
#define CYASSL_ERROR(e)
|
|
|
|
#define CYASSL_MSG(m)
|
|
|
|
|
|
|
|
#endif /* DEBUG_CYASSL */
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* CYASSL_MEMORY_H */
|