UltiBlox on GitHub | UltiBlox Home
SerialLogger is an open-source Arduino library for structured data logging and debugging. It supports multiple log levels and output formats, making it easy to log information from your Arduino and integrate with external systems.
Core features:
- Configurable log levels:
DEBUG,INFO,DATA. - Flexible output formats: human-readable or machine-readable.
- Simple integration with tools like Python for data parsing.
To clone the library, run:
git clone [email protected]:UltiBlox/SerialLogger.git
cd SerialLoggerRun the installation script to set up the library:
bash install.shFor development use:
bash install-symlink.shControl logging behavior by setting the log level and format in your sketch:
// Set log level
#define LOG_LEVEL LOG_LEVEL_DATA
// Set log format
#define LOG_FORMAT LOG_FORMAT_MACHINE
#include "SerialLogger.h"- Open one of the example sketches (e.g.,
DataLogging.ino) in the Arduino IDE. - Upload it to your Arduino.
- View the output in the Serial Monitor.
- If using the
DataLoggingexample, parse the output with the stream_data.py script.
The library includes several examples to get you started:
- DataLogging: Logs structured data for Python parsing. See the Python Integration Guide for details.
- DebugLogging: Logs debug messages for troubleshooting.
- InfoLogging: Logs essential information for production.
Detailed descriptions are available in the examples documentation.
Logger.data(label, key, value): Logs a key-value pair.Logger.dataln(): Ends the current log line.Logger.info(message): Logs an info-level message.Logger.debug(message): Logs a debug-level message.Logger.print(message): Directly outputs a message to the serial console.Logger.println(message): Outputs a message with a newline.
For more details, see the Configuration Guide.
Explore the following resources for more details:
- Configuration Options
- Key-Value Pair Structure
- Python Integration
- Examples
- Installation and Development