Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: MiniTLS-HTTPS-Example
debug.h
00001 /* 00002 MiniTLS - A super trimmed down TLS/SSL Library for embedded devices 00003 Author: Donatien Garnier 00004 Copyright (C) 2013-2014 AppNearMe Ltd 00005 00006 This program is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU General Public License 00008 as published by the Free Software Foundation; either version 2 00009 of the License, or (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; if not, write to the Free Software 00018 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00019 *//** 00020 * \file debug.h 00021 * \copyright Copyright (c) AppNearMe Ltd 2013 00022 * \author Donatien Garnier 00023 */ 00024 00025 #ifndef DEBUG_H_ 00026 #define DEBUG_H_ 00027 00028 #include "fwk.h" 00029 00030 #ifdef __cplusplus 00031 extern "C" { 00032 #endif 00033 00034 #if !DEBUG_DISABLED 00035 00036 void debug(int level, const char* module, int line, const char* fmt, ...); 00037 void debugx_enter(void); 00038 void debugx(const char* fmt, ...); 00039 void debugx_leave(void); 00040 void assert_failed(const char* module, int line, const char* condition); 00041 00042 #define assert(condition) do{ if(!(condition)){ assert_failed(__MODULE__, __LINE__, #condition); } } while(0) 00043 00044 #else 00045 #ifdef __DEBUG__ 00046 #undef __DEBUG__ 00047 #define __DEBUG__ 0 00048 #endif 00049 00050 #define assert(condition) 00051 00052 #endif 00053 00054 #if __DEBUG__ > 0 00055 #ifndef __MODULE__ 00056 #error "__MODULE__ must be defined" 00057 #endif 00058 #endif 00059 00060 #if __DEBUG__ >= 1 00061 #define ERR(...) do{ debug(1, __MODULE__, __LINE__, __VA_ARGS__); }while(0) 00062 #else 00063 #define ERR(...) 00064 #endif 00065 00066 #if __DEBUG__ >= 2 00067 #define WARN(...) do{ debug(2, __MODULE__, __LINE__, __VA_ARGS__); }while(0) 00068 #else 00069 #define WARN(...) 00070 #endif 00071 00072 #if __DEBUG__ >= 3 00073 #define DBG(...) do{ debug(3, __MODULE__, __LINE__, __VA_ARGS__); }while(0) 00074 #define DBGX_ENTER() do{ debugx_enter(); }while(0) 00075 #define DBGX(...) do{ debugx(__VA_ARGS__); }while(0) 00076 #define DBGX_LEAVE() do{ debugx_leave(); }while(0) 00077 #define DBG_BLOCK(x) x 00078 #else 00079 #define DBG(...) 00080 #define DBGX_ENTER() 00081 #define DBGX(...) 00082 #define DBGX_LEAVE() 00083 #define DBG_BLOCK(x) 00084 #endif 00085 00086 #if __DEBUG__ >= 4 00087 #define VERB(...) do{ debug(4, __MODULE__, __LINE__, __VA_ARGS__); }while(0) 00088 #else 00089 #define VERB(...) 00090 #endif 00091 00092 #ifdef __cplusplus 00093 } 00094 #endif 00095 00096 #endif 00097
Generated on Wed Jul 13 2022 00:22:54 by
1.7.2