On 08/03/2011 09:10 AM, Gabriel Scherer wrote:
Both pa_macros and cppo have a file-inclusion directive, so you could
define your preferred location-reporting macro in a header file.
That said, I would personally use the __LOCATION__ macro directly: the
less preprocessing stuff the better, and if it "clutters your code"
you could restrict your reporting a bit, which may not be a bad thing:
having a log full of useless stuff is only a bit better than having no
log.
I fully agree that too much log information makes to log pretty useless.
But I was not allowed to use __LOCATION__ all over the place, so I wrote
a small syntax extension that will automatically call our log function
with location as argument.
You may also be interested in the existing logging frameworks for
OCaml, such as Bolt:
http://bolt.x9c.fr/
We actually did try it out, but we could not get it to do log rotation
properly. We ended up logging to stdout and pipe stdout through a
program that would send all data to disk, and reopen files whenever it
received HUP sigal. logrotate would then do the actual log rotation.
Thanks for all the suggestions and pointers. Very helpful indeed.
Regards
Anders
--
Caml-list mailing list. Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs