forked from sparkfun/WiFly-Shield
-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathDebug.h
More file actions
36 lines (24 loc) · 709 Bytes
/
Debug.h
File metadata and controls
36 lines (24 loc) · 709 Bytes
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
/*
Debug.h -- Utility macros for debug logging
NOTE: Requires Serial.begin() to have been called previously or the messages
will be lost.
If DEBUG_LEVEL is 0 or undefined no logging occurs.
Higher DEBUG_LEVEL values should cause more detail to be displayed.
*/
#ifndef __DEBUG_H__
#define __DEBUG_H__
#ifndef DEBUG_LEVEL
#define DEBUG_LEVEL 0
#endif
#if DEBUG_LEVEL == 0
#define DEBUG_LOG(level, message)
#else
// TODO: Store strings in PROGMEM?
// TODO: Modify so lower level messages/conditionals aren't compiled at all?
#define DEBUG_LOG(level, message) \
if (DEBUG_LEVEL >= level) {\
Serial.print(F("DEBUG: "));\
Serial.println(F(message));\
};
#endif
#endif