1. Pre-submission Checklist
2. Description
What went wrong? src/Makefile line 88 reads CXXFLAGS += -D_T3_WIDGET_DEBUG with no debug/release conditional around it, so every build of the library has debug logging compiled in permanently. This causes src/log.cc's init_log() to unconditionally fopen("libt3widgetlog.txt", "a") in the current working directory whenever any program linking against libt3widget runs.
What did you expect to happen? Debug logging should only be active in debug builds, not always-on in every build.
What actually happened? Any program using libt3widget (e.g. Tilde, see gphalkes/tilde#128) silently creates libt3widgetlog.txt in whatever directory it's run from, with no way to disable it short of patching the library and recompiling.
3. Steps to Reproduce
- Build
libt3widget from src/Makefile as-is
- Run any program linked against it from an arbitrary directory
- Observe
libt3widgetlog.txt appears in that directory
Reproducible consistently? Yes, by inspection of the unconditional flag, not just an occasional occurrence.
4. Version Information
| Item |
Value |
| Project version |
master branch, 2026-06-18 |
| Last known working version |
N/A, appears to have always been unconditional |
5. Environment
N/A, this is independent of OS/environment, it's a build-time flag issue.
6. Relevant Logs and Output
N/A, no error, just unwanted file creation.
7. Relevant Configuration
src/Makefile, line 88:
CXXFLAGS += -D_T3_WIDGET_DEBUG
8. Suggested Fix
Gate the flag behind a make variable rather than removing debug capability entirely, e.g.:
ifeq ($(DEBUG),1)
CXXFLAGS += -D_T3_WIDGET_DEBUG
endif
This keeps the logging available for anyone actively debugging (make DEBUG=1), while making a default make build behave as a normal release build with no stray log files. Happy to put together a small PR for this if it's a welcome change.
9. Additional Context
Found while investigating gphalkes/tilde#128, which reports both log.txt and libt3widgetlog.txt being created on every run. This issue accounts for the libt3widgetlog.txt half of that report.
1. Pre-submission Checklist
2. Description
What went wrong?
src/Makefileline 88 readsCXXFLAGS += -D_T3_WIDGET_DEBUGwith no debug/release conditional around it, so every build of the library has debug logging compiled in permanently. This causessrc/log.cc'sinit_log()to unconditionallyfopen("libt3widgetlog.txt", "a")in the current working directory whenever any program linking againstlibt3widgetruns.What did you expect to happen? Debug logging should only be active in debug builds, not always-on in every build.
What actually happened? Any program using
libt3widget(e.g. Tilde, see gphalkes/tilde#128) silently createslibt3widgetlog.txtin whatever directory it's run from, with no way to disable it short of patching the library and recompiling.3. Steps to Reproduce
libt3widgetfromsrc/Makefileas-islibt3widgetlog.txtappears in that directoryReproducible consistently? Yes, by inspection of the unconditional flag, not just an occasional occurrence.
4. Version Information
5. Environment
N/A, this is independent of OS/environment, it's a build-time flag issue.
6. Relevant Logs and Output
N/A, no error, just unwanted file creation.
7. Relevant Configuration
8. Suggested Fix
Gate the flag behind a make variable rather than removing debug capability entirely, e.g.:
This keeps the logging available for anyone actively debugging (
make DEBUG=1), while making a defaultmakebuild behave as a normal release build with no stray log files. Happy to put together a small PR for this if it's a welcome change.9. Additional Context
Found while investigating gphalkes/tilde#128, which reports both
log.txtandlibt3widgetlog.txtbeing created on every run. This issue accounts for thelibt3widgetlog.txthalf of that report.