micropython-mqtt icon indicating copy to clipboard operation
micropython-mqtt copied to clipboard

mqtt_as: Added optional logging functionality.

Open TrevisGordan opened this issue 6 years ago • 0 comments

Hello Peter, This is the second functionality I added to mqtt_as. This one is rather a nice gimmick in some peoples eyes id say. But I think it is actually helpful.

Added optional logging functionality. In addition to the DEBUG option which prints to the console, I added Logging ability which prints the statements a Log message. Inovekd with MQTTClient.LOGGING = True

  • ln 23: It Checks if the standard Micropython logging module is available. If not, it will fail silently. This prevents breaking code. Only if the user activates LOGGING - he should be aware that he needs the logging module otherwise he will not see any output (Documentation).

  • ln 561: I changed the "Ram Free"-message to use the "dprint" function, for logging ability.

as said before, in case you like both additions I have a third pull request combining them.

TrevisGordan avatar Sep 10 '19 16:09 TrevisGordan