---
title: "Delayed printf for real-time logging"
url: https://daily.dev/posts/delayed-printf-for-real-time-logging-hwlan0brw
source_url: https://www.embeddedrelated.com/showarticle/518.php
type: article
source: "EmbeddedRelated"
published: 2026-05-31T07:48:34.135Z
updated: 2026-05-31T09:11:16.529Z
tags: ["logging", "c++", "embedded", "real-time-systems"]
reading_time: 9
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Delayed printf for real-time logging

**[EmbeddedRelated](https://daily.dev/sources/embeddedrelated)** · 9 min read · 0 upvotes · 0 comments

## Summary

Delayed printf is a technique for low-overhead logging in real-time and embedded systems. Instead of formatting text at runtime, it stores the format string pointer and raw argument words into a compact buffer using C++11 variadic templates and an atomic fetch-and-add operation. A separate GDB Python script later reconstructs the formatted messages by reading strings from the executable or core dump. This approach supports logging from interrupt handlers and multiple threads without locks, and allows inspection of unflushed messages in live debug sessions or core dumps.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.embeddedrelated.com/showarticle/518.php>

## Similar posts on daily.dev

- [Medium](https://daily.dev/posts/medium-qywq6zdry) · Medium · 0 upvotes · 0 comments

---

Tags: [#logging](https://daily.dev/tags/logging), [#c++](https://daily.dev/tags/c++), [#embedded](https://daily.dev/tags/embedded), [#real-time-systems](https://daily.dev/tags/real-time-systems)

[View this post on daily.dev](https://daily.dev/posts/delayed-printf-for-real-time-logging-hwlan0brw)
