mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-04 02:48:13 +10:00
Add ability to customize debug prefix
This commit is contained in:
+6
-1
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user