[m-dev.] logging proposal

Peter Ross pro at missioncriticalit.com
Mon Feb 27 22:19:36 AEDT 2006


On Mon, Feb 27, 2006 at 09:31:16PM +1100, Ian MacLarty wrote:
> Hi,
> 
> As a result of the recent discussion about how to trick Mercury into not
> optimising away logging calls, I am proposing the following simple
> solution:
> 
> We add a special procedure `log' to the builtin module.  The new
> procedure takes a string as input (or possibly an I/O closure).  The
> compiler is then modified to treat calls to log as being the same as
> true, unless an "--enable-logging" options is given.  If this option is
> given then the logging predicates write their output somewhere (where
> they write their output could be given by another mmc option).
> 
> What are the feelings on introducing such a scheme?  Clearly some kind
> of logging feature is necessary, especially for very long running
> programs that would be too slow in debugging grades. Also it would be
> better that user's could add a logging mechanism to their code without
> tricking and/or lying to the compiler.
> 
> We could also have different levels of logging.
> 
Why don't we just use the log4m module that I posted to the list quite
awhile ago, it has the advantage of being extremely flexible, and with
a bit of work I think one could make the determination of whether to log
or not much more efficient.

It works well in the long-running server that we are developing.

Pete
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list