forked from Edzelf/Esp-radio
-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathConsoleLogger.h
More file actions
31 lines (28 loc) · 1010 Bytes
/
ConsoleLogger.h
File metadata and controls
31 lines (28 loc) · 1010 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
/**
* Licensed under GNU GPLv3 <http://gplv3.fsf.org/>
* Copyright © 2018
*
* @author Marcin Szalomski (github: @baldram | twitter: @baldram)
*/
#ifndef __ESP_VS1053_LIBRARY_CONSOLE_LOGGER__
#define __ESP_VS1053_LIBRARY_CONSOLE_LOGGER__
/**
* To enable debug, add build flag to your platformio.ini as below (depending on platform).
*
* For ESP8266:
* build_flags = -D DEBUG_ESP_PORT=Serial
*
* For ESP32:
* build_flags = -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
*
*/
#ifdef ARDUINO_ARCH_ESP32
#define LOG(...) ESP_LOGD("ESP_VS1053", __VA_ARGS__)
#elif defined(ARDUINO_ARCH_ESP8266) && defined(DEBUG_ESP_PORT)
#define LOG(...) DEBUG_ESP_PORT.printf(__VA_ARGS__)
#elif defined(ARDUINO_ARCH_RP2040) && defined(DEBUG_RP2040_PORT) && defined(DEBUG_VS1053)
#define LOG(...) DEBUG_RP2040_PORT.printf(__VA_ARGS__)
#else
#define LOG(...)
#endif
#endif // __ESP_VS1053_LIBRARY_CONSOLE_LOGGER__