🟢 super fast 🚀 tiny 🐥 𝘾 printf-look-and-feel ✍ trace code, in ⚡ interrupts ⚡ too ‼️, and real-time PC 💻 logging 👀
Hi, I am Trice.
Log in (a) trice (S>G) 
even inside ↯ interrupts in less than 1 µs❗
Trice replaces printf or log in C code and gives you three main benefits:
Instead of storing log strings on your embedded device, Trice keeps them on your PC. This makes logging faster and uses less memory on your device.
- No version mismatch problems❗
+ The Trice ID List stores all log strings, so the
+ newest version can read logs from all older versions❗
printf but creates very fast trace and log code for your embedded deviceYou can use Trice for printf debugging and as a logging system. The advantage is very short messages (no strings) for data transfer. Remember that the file til.json is needed to read all output from devices in the field for 10+ years.
Trice looks like data compression (IDs instead of strings), which is useful for IoT devices, especially NB-IoT with very low data rates.
Store Trice messages in FLASH memory for later analysis. A typical trice uses only 4 bytes, no matter how long the format string is.
You can encrypt Trice transfer packets for security.
Translate the til.json file into different languages. Change the language by changing the til.json file without changing the target binary.
Trice makes timing analysis easy on distributed embedded systems. It supports both host and target timestamps.
This simplified diagram shows how Trice works. Read the detailed explanation here.
trice ds in a console on your local PC or a remote PC. Then connect several trice tool instances using commands like trice log -p COM15 -dstrice help -all in a terminal or reading tricehelpall_test.gogo install ./cmd/trice/... afterwards)Debug a Trice project in Direct-Out Mode over SEGGER-RTT. (See Development Environment Setup for details.)

You can use the -cache CLI switch with trice insert and trice clean commands. This only works when you create the .trice/cache folder in your home directory. (Trice Cache Details)
Use cache when you:
trice i ... before compilingtrice c ... after compilingThe Trice cache saves copies of all files after processing them with trice i or trice c. This avoids inserting and removing IDs repeatedly. The copies are used to get the same results for files that have not been edited. Edited files are processed normally and the cache updates afterwards. File modification times do not change, so the build system does not reprocess unchanged files even when IDs are temporarily removed.
Be careful when your build system also modifies source files!
For example, run an auto-formatter before the trice insert command.
Trice is fully usable. There are no known bugs (see issues).
+ Please use v1.0, v1.1, or the main branch if you want to build from source.
- Do not use the "dev" branch right now (December 2025) - it may not work properly.
The documentation could be improved. We could add features like remote procedure calls. Or create a separate tlog tool written in C or Python (with AI help). This would allow logging on any platform, not just platforms supported by Go.
Trice will soon support structured logging. Based on feedback from #531, there is now a specification draft. Please provide feedback before implementation starts.
Become a Sponsor with your Github Account
OR
OR
git clone https://github.com/rokath/trice.git
Trice Compare (generated 2025-05-26)
Logging & Tracing Solutions for Embedded Systems (generated 2026-02-16)