hideakitai / ArtNet

Art-Net Sender/Receiver for Arduino (Ethernet, WiFi)
MIT License
257 stars 52 forks source link

Allow redefinition of where logging goes #111

Closed thirstyice closed 4 months ago

thirstyice commented 4 months ago

Sometimes I want to log to places other than Serial (when I have a display connected, or when my adapter is attached to Serial1 for example)

Also adds guards so things don't break when the user disables Serial

thirstyice commented 4 months ago

Added a subclass of Print that does nothing, which is now the default log output. The user can then choose if + where to log by calling logOutputTo.

Removed b_verbose, as it seemed redundant to have to call 2 separate functions to enable logging.

This way we also don't have to worry about what happens if Serial is undefined, that becomes the user's problem.