Skip to content

Commit cc36fff

Browse files
committed
- setDebugMessageLevel() will now accept -1 to disable logging
1 parent def90bb commit cc36fff

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Diff for: src/ConnectionManager.h

+5-4
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
#ifndef CONNECTION_MANAGER_H_INCLUDED
1919
#define CONNECTION_MANAGER_H_INCLUDED
2020

21-
#ifndef ARDUINO_CLOUD_DEBUG_LEVEL
2221
#define ARDUINO_CLOUD_DEBUG_LEVEL 2
23-
#endif
2422

2523
#include <Client.h>
2624

@@ -77,7 +75,10 @@ class ConnectionManager {
7775
#endif
7876

7977
static int debugMessageLevel = ARDUINO_CLOUD_DEBUG_LEVEL;
80-
inline void debugMessage(char *_msg, uint8_t _debugLevel, bool _timestamp = true, bool _newline = true) {
78+
inline void debugMessage(char *_msg, int _debugLevel, bool _timestamp = true, bool _newline = true) {
79+
if(_debugLevel < 0){
80+
return;
81+
}
8182
if (_debugLevel <= debugMessageLevel) {
8283
char prepend[20];
8384
sprintf(prepend, "\n[ %d ] ", millis());
@@ -92,7 +93,7 @@ inline void debugMessage(char *_msg, uint8_t _debugLevel, bool _timestamp = true
9293
}
9394
}
9495

95-
inline void setDebugMessageLevel(uint8_t _debugLevel){
96+
inline void setDebugMessageLevel(int _debugLevel){
9697
debugMessageLevel = _debugLevel;
9798
}
9899
#endif

0 commit comments

Comments
 (0)