guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error reporting


From: Neil Jerram
Subject: Re: Error reporting
Date: Sun, 23 Nov 2008 11:48:23 +0000

2008/11/21 Sebastian Tennant <address@hidden>:
> Hi all,
>
> I very much doubt it's possible, but is there any way of getting Guile
> to include a timestamp in it's error reporting?
>
> For example:
>
>  guile> foo
>  2008-11-20 23:17:11 ERROR: Unbound variable: foo
>  2008-11-20 23:17:11 ABORT: (unbound-variable)

How about a soft output port that automatically adds a timestamp when
something is written to it?

You could implement a basic version of this very quickly - outputting
a timestamp whenever the port's display proc is called.  But that
might generate more timestamps than are useful, and not always at line
breaks.  So you could then get more sophisticated by

- scanning what is being output for a linebreak, and inserting the
timestamp there

- only inserting a timestamp if it has changed since the last one that
was output.

Then your web server would create one of these ports, and use it as
its error port.

Regards,
   Neil




reply via email to

[Prev in Thread] Current Thread [Next in Thread]