ABC verbose printing
rikushoney opened this issue · 0 comments
rikushoney commented
ABC is very verbose and prints to stdout. We should probably intercept those prints and filter them.
Many prints seem to be done by a call to Abc_Print
but most are still done with regular printf
rg --stats --quiet Abc_Print
# 10153 matches
# 10145 matched lines
# 332 files contained matches
# ...
vs
rg --stats --quiet printf
# 24778 matches
# 24706 matched lines
# 1111 files contained matches
# ...
We can "hook" the calls to Abc_Print
(and derivatives) by overriding the definition of the function(s) based on a compile define, e.g. -DVTS_ABC_HOOK_PRINT=1
. The new definition will call a "fault handler" callback which can be configured at runtime. The default fault handler can simply print to stderr.
This is similar to what LLVM does for fatal errors.