← Back to list

debug-log
by mgreenly
An AI Coding Agent
⭐ 1🍴 0📅 Jan 24, 2026
SKILL.md
name: debug-log description: Printf-style debug logging for development-time visibility
Debug Log
Printf-style logging for development and debugging. Compiles away completely in release builds.
Purpose
- Development-time visibility into program state
- Add arbitrary trace points during debugging
- Zero overhead in release builds
Usage
#include "debug_log.h"
DEBUG_LOG("value=%d state=%s", x, state_name);
DEBUG_LOG("=== Entering function ===");
DEBUG_LOG("buffer contents: %.*s", (int)len, buf);
Build Configuration
| Build | DEBUG defined | Behavior |
|---|---|---|
| Debug | Yes | Writes to IKIGAI_DEBUG.LOG |
| Release | No | Compiles to ((void)0) - removed entirely |
Initialization
In debug builds, call once early in main():
#ifdef DEBUG
ik_debug_log_init();
#endif
Or simply use the macro form (safe in any build):
ik_debug_log_init(); // No-op if DEBUG not defined
Output Format
[2025-01-15 10:30:00] src/client.c:34:main: === Session starting, PID=12345 ===
Format: [timestamp] file:line:function: message
Log Location
- File:
IKIGAI_DEBUG.LOGin working directory - Truncated on each run (via
ik_debug_log_init)
Inspecting Logs
tail -f IKIGAI_DEBUG.LOG
Alternate Buffer Note
ikigai runs in terminal alternate buffer mode. printf() and fprintf(stderr, ...) are not visible during execution. Use DEBUG_LOG instead.
Source Files
src/debug_log.h- Macro definitionsrc/debug_log.c- Implementation (excluded from coverage)
Score
Total Score
60/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon