-
Notifications
You must be signed in to change notification settings - Fork 0
/
Logging.h
33 lines (30 loc) · 1.25 KB
/
Logging.h
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
/*
* Logging.h
*
* Created on: 13 Sep 2017
* Author: adrcab01
*/
#ifndef LOGGING_H_
#define LOGGING_H_
#include "mbed.h"
#define LOGGING_ENABLED 1
#ifdef LOGGING_ENABLED
#define LOG_DEBUG(message) printf("[DEBUG]: %s\r\n",message);
#define LOG_DEBUG_DOUBLE_VALUE(value_name,value) printf("[DEBUG]: %s=%g\r\n",value_name,value);
#define LOG_DEBUG_INTEGER_VALUE(value_name,value) printf("[DEBUG]: %s=%d\r\n",value_name,value);
#define LOG_DEBUG_HEXADECIMAL_VALUE(value_name,value) printf("[DEBUG]: %s=%x\r\n",value_name,value);
#define LOG_TRACE(message) printf("[TRACE]: %s\r\n",message);
#define LOG_TRACE_DOUBLE_VALUE(value_name,value) printf("[TRACE]: %s=%g\r\n",value_name,value);
#define LOG_TRACE_INTEGER_VALUE(value_name,value) printf("[TRACE]: %s=%d\r\n",value_name,value);
#define LOG_TRACE_HEXADECIMAL_VALUE(value_name,value) printf("[TRACE]: %s=%x\r\n",value_name,value);
#else
#define LOG_DEBUG(x)
#define LOG_DEBUG_DOUBLE_VALUE(value_name,value)
#define LOG_DEBUG_INTEGER_VALUE(value_name,value)
#define LOG_DEBUG_HEXADECIMAL_VALUE
#define LOG_TRACE(message)
#define LOG_TRACE_DOUBLE_VALUE(value_name,value)
#define LOG_TRACE_INTEGER_VALUE(value_name,value)
#define LOG_TRACE_HEXADECIMAL_VALUE(value_name,value)
#endif
#endif /* LOGGING_H_ */