-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug.h
More file actions
20 lines (17 loc) · 810 Bytes
/
Copy pathdebug.h
File metadata and controls
20 lines (17 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#pragma once
#include <Arduino.h>
// Toggle these in one place — disable in production to avoid leaking
// AT commands, device tokens, and API URLs over serial.
static bool DEBUG_AT = true;
static bool DEBUG_HTTP = false;
#define LOGI(...) do { Serial.printf(__VA_ARGS__); Serial.println(); } while(0)
#define LOGW(...) do { Serial.printf(__VA_ARGS__); Serial.println(); } while(0)
#define LOGE(...) do { Serial.printf(__VA_ARGS__); Serial.println(); } while(0)
#define LOG_AT(cmd, resp) do { \
if (DEBUG_AT) { \
Serial.print("\nAT>> "); Serial.print(cmd); \
Serial.print("RESP: "); \
if (resp) Serial.println(resp); \
else Serial.println("(null)"); \
} \
} while(0)