ArdLog serves as simple logger for Arduino that creates formatted messages over Serial:
- Each message has timestamp.
- Each message within single loop has the same timestamp, so that you can logically connect activities together.
- Messages can be formatted using sprintf syntax.
- Text for the messages is being held in PROGMEM.
InstallationIn order to install ArdLog you have to download desired release and unpack in into folder containing Arduino libraries. The is the result on MacOS:
- Logger is disabled by default, in order to enable it set LOG to true.
- Messages are created over default Serial port. You can choose alternative port by setting: USE_SERIAL_1, USE_SERIAL_2 or USE_SERIAL_3 to true.
- In order to print current time for each message set USE_CURRENT_TIME to true. By default logger will sample time only once at the beginning of each loop.
Getting up and running
- Choose suitable configuration in ArdLog.h. In most cases you have to only set LOG to true.
- Call log_setup() in setup() method - this will initialize serial port.
- Call log_cycle() at the beginning of each loop() - it will sample current time.
- Put log messages into #if LOG log(F("....") #endif - once logger is disabled, it will not waste RAM and CUP.
This is output created by example above: