Skip to content
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

libary logging function deactivate? #176

Closed
radontec opened this issue Dec 22, 2023 · 4 comments · Fixed by #180
Closed

libary logging function deactivate? #176

radontec opened this issue Dec 22, 2023 · 4 comments · Fixed by #180

Comments

@radontec
Copy link

If there is no Internet connection, the libary displays error messages every second.
How can the logger function be switched off?

@MathewHDYT
Copy link
Contributor

The library itself does not log only because you lost the internet connection. The part doing the logging in this case, are the examples main.cpp files.

Simply remove these lines in the main method:

Serial.printf("Connecting to: (%s) with token (%s)\n", THINGSBOARD_SERVER, TOKEN);
Serial.println("Failed to connect");

@radontec
Copy link
Author

thx for you answer, I have to be more specific
I must adjust the log functions just from the libary not from my whole project
where can I find it? (VS code)

@MathewHDYT
Copy link
Contributor

MathewHDYT commented Dec 22, 2023

There is a section in the documentation on how you can exchange the logger with your own implementation. Simply do that and if you do not want the logging functions to log anything, simply let the methods be empty.

Disabling messages is not recommended tough, because per default the library only logs errors. Meaning if logs are disabled debugging issues might be much harder or not even detected in the first place.

@MathewHDYT
Copy link
Contributor

@imbeacon Would be nice if this issue could be closed, because the requested functionality already exists and is documented in the library ReadMe.md

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 a pull request may close this issue.

3 participants