Add ability to customize debug prefix

This commit is contained in:
tablatronix
2021-03-06 11:25:38 -06:00
parent 133dd8cd52
commit c48173e32a
2 changed files with 10 additions and 3 deletions
+6 -1
View File
@@ -2468,6 +2468,11 @@ void WiFiManager::setDebugOutput(boolean debug) {
if(_debug && _debugLevel == DEBUG_DEV) debugPlatformInfo();
}
void WiFiManager::setDebugOutput(boolean debug, String prefix) {
_debugPrefix = prefix;
setDebugOutput(debug);
}
/**
* [setAPStaticIPConfig description]
* @access public
@@ -3015,7 +3020,7 @@ void WiFiManager::DEBUG_WM(wm_debuglevel_t level,Generic text,Genericb textb) {
_debugPort.printf("[MEM] free: %5d | max: %5d | frag: %3d%% \n", free, max, frag);
#endif
}
_debugPort.print("*WM: ");
_debugPort.print(_debugPrefix);
if(_debugLevel >= debugLvlShow) _debugPort.print("["+(String)level+"] ");
_debugPort.print(text);
if(textb){
+4 -2
View File
@@ -236,7 +236,8 @@ class WiFiManager
// toggle debug output
void setDebugOutput(boolean debug);
void setDebugOutput(boolean debug, String prefix); // log line prefix, default "*wm:"
//set min quality percentage to include in scan, defaults to 8% if not specified
void setMinimumSignalQuality(int quality = 8);
@@ -599,7 +600,8 @@ class WiFiManager
} wm_debuglevel_t;
boolean _debug = true;
String _debugPrefix = "*wm:";
wm_debuglevel_t debugLvlShow = DEBUG_VERBOSE; // at which level start showing [n] level tags
// build debuglevel support