Skip to content

possibility to disable logging #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 20, 2019
Merged

possibility to disable logging #35

merged 1 commit into from
Feb 20, 2019

Conversation

ubidefeo
Copy link
Collaborator

  • setDebugMessageLevel() will now accept -1 to disable logging

@ubidefeo ubidefeo requested a review from facchinm February 15, 2019 15:29
@@ -18,9 +18,7 @@
#ifndef CONNECTION_MANAGER_H_INCLUDED
#define CONNECTION_MANAGER_H_INCLUDED

#ifndef ARDUINO_CLOUD_DEBUG_LEVEL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd leave the guard to allow multiple inclusion of this file

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@facchinm this is only to define a default in case it wasn't defined in the sketch, but it's definitely not needed anymore.
there's still a check against multiple inclusion

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

static int debugMessageLevel = ARDUINO_CLOUD_DEBUG_LEVEL;
inline void debugMessage(char *_msg, uint8_t _debugLevel, bool _timestamp = true, bool _newline = true) {
inline void debugMessage(char *_msg, int _debugLevel, bool _timestamp = true, bool _newline = true) {
if(_debugLevel < 0){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this check is probably not needed if we only allow messages from 0 up 🙂

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mh... better safe than sorry? :)

@facchinm facchinm merged commit 9bd3554 into master Feb 20, 2019
@ubidefeo ubidefeo deleted the disable-logging branch February 20, 2019 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants