edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
* [Edbrowse-dev] debugging output to a file
@ 2016-01-13  8:57 Karl Dahlke
  2016-01-13 19:05 ` Geoff McLane
  0 siblings, 1 reply; 4+ messages in thread
From: Karl Dahlke @ 2016-01-13  8:57 UTC (permalink / raw)
  To: Edbrowse-dev

A feature that has long been requested.
To send your debugging output to a file, do this.

db>/tmp/h

To go back to stdout,

db>

When sent to a file, messages at level 1 and 2 are still sent to stdout.
Otherwise you wouldn't be able to see what you're doing so to speak.

Debug file is limited to 10 megs.
I wanted some kind of cap on it, because sometimes I am using
debug information to track down an infinite loop.

I use setlinebuf to make sure the log is up to date,
even if the program seg faults.
(This has to be tweaked for windows, no such function.)

This was somewhat tedious, but made easier by the internationalization
of all the messages.
In other words, all the mainstream output vectors through eb_puts(),
so I just add some code in there to tee it over to the debug file if present.
That takes care of the regular output, then the input which is just in one place,
then debugPrint(), and a few more weird situations, and we're there.

Karl Dahlke

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-01-16 14:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-13  8:57 [Edbrowse-dev] debugging output to a file Karl Dahlke
2016-01-13 19:05 ` Geoff McLane
2016-01-13 19:23   ` Geoff McLane
2016-01-16 14:46     ` Adam Thompson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).