edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
From: Karl Dahlke <eklhad@comcast.net>
To: Edbrowse-dev@lists.the-brannons.com
Subject: [Edbrowse-dev] debugging output to a file
Date: Wed, 13 Jan 2016 03:57:42 -0500	[thread overview]
Message-ID: <20160013035742.eklhad@comcast.net> (raw)

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

             reply	other threads:[~2016-01-13  8:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-13  8:57 Karl Dahlke [this message]
2016-01-13 19:05 ` Geoff McLane
2016-01-13 19:23   ` Geoff McLane
2016-01-16 14:46     ` Adam Thompson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160013035742.eklhad@comcast.net \
    --to=eklhad@comcast.net \
    --cc=Edbrowse-dev@lists.the-brannons.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).