add support for build debug flags

WM_DEBUG_LEVEL
WM_DEBUG_PORT
closes #965
This commit is contained in:
tablatronix
2019-11-13 22:47:55 -06:00
parent fb29462e73
commit 768ead409e
2 changed files with 16 additions and 3 deletions
+1 -1
View File
@@ -184,7 +184,7 @@ WiFiManager::WiFiManager(Stream& consolePort):_debugPort(consolePort){
WiFiManagerInit();
}
WiFiManager::WiFiManager():WiFiManager(Serial) {
WiFiManager::WiFiManager() {
}
void WiFiManager::WiFiManagerInit(){
+15 -2
View File
@@ -490,9 +490,22 @@ class WiFiManager
} wm_debuglevel_t;
boolean _debug = true;
uint8_t _debugLevel = DEBUG_DEV;
Stream& _debugPort; // debug output stream ref
// build debuglevel support
// @todo use DEBUG_ESP_x?
#ifdef WM_DEBUG_LEVEL
uint8_t _debugLevel = (uint8_t)WM_DEBUG_LEVEL;
#else
uint8_t _debugLevel = DEBUG_DEV; // default debug level
#endif
// @todo use DEBUG_ESP_PORT ?
#ifdef WM_DEBUG_PORT
Stream& _debugPort = WM_DEBUG_PORT;
#else
Stream& _debugPort = Serial; // debug output stream ref
#endif
template <typename Generic>
void DEBUG_WM(Generic text);