Closed Bug 1100741 Opened 10 years ago Closed 10 years ago

add helper that produces a FILE* that sends its output to logcat, to avoid having to mass-convert debugging code to fprintf_stderr

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: dbaron, Assigned: dbaron)

Details

There's a lot of existing debugging code in layout that takes a FILE* to send its output to. While we probably should convert that to use fprintf_stderr, sometimes it doesn't feel productive to go through and mass-convert lots of dumping code scattered throughout the tree (e.g., a virtual dump function, as on frames, style rules, etc.). Today I wrote (to debug bug 1089417) a little helper code that uses pipe() and produces a FILE* that prints to logcat. (I still need to move the code into a decent location, but that should be pretty simple.) This isn't meant to preempt any larger plans to improve our logging situation, but it's a useful helper for dealing with the logging code that we currently have.
Although given the limitation of the pipe buffer size (I presume it will hang if too much is written), I'm having second thoughts about adding this as a general mechanism, though it was certainly useful for me today. (I'm not sure if sockets are any better in terms of buffering.) Maybe now that I understand the (previously poorly documented, but documentation improved in the first patch) distinction between printf_stderr and fprintf_stderr, maybe we should just move faster on switching all debugging code that logs to files to use fprintf_stderr.
The patch I had was: https://hg.mozilla.org/users/dbaron_mozilla.com/patches/raw-file/cbb50bbf3839/auto-android-log-file but I'm going to WONTFIX this, and split the documentation patch into bug 1100770.
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.