Subject: PreTraceHook, PostTraceHook and ErrorHdrHook hooks in RTS
From: Krasimir Angelov <[email-masked]>
To: [email-masked]
Date: Fri, 6 Feb 2004 12:07:12 -0800 (PST)
List-Id: GHC/CVS discussion and fptools/ghc CVS commit messages <cvs-ghc.haskell.org>

Dear GHC team,

The current RTS hooks allow to change the default
behaviour of "trace" and "error" functions in Haskell.
The disadvantage of the current implementation is that
 one can change either the header or the footer of the
displayed message. In some cases it is useful to do
something more. For example in GUI application it is
better to display the error message in a dialog box
instead of dumping it to the error console. On the
other hand under Windows we may want to dump a trace
messages to the debug console (OutputDebugString)
insted of dumping it to the error console. 

My proposal is to replace the hooks:

void PreTraceHook(long fd);
void PostTraceHook(long fd);
void ErrorHdrHook(long fd);

with the general hooks:

void TraceHook(char *msg)
{
   fputs(msg, stderr);
}

void ErrorHook(char *msg)
{
   fprintf(stderr, "Fail: %s", msg);
}

I am waiting forward to your comments and proposals.
If you accept the idea, I will be happy to implement
it.

Cheers,
Krasimir

__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html
_______________________________________________
Cvs-ghc mailing list
[email-masked]
http://www.haskell.org/mailman/listinfo/cvs-ghc