From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p747wOGX011376 for ; Thu, 4 Aug 2011 09:58:24 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap4EAI1QOk5auLfF/2dsb2JhbABCqFuBQAEBBAE4QAEQCxgJFg8JAwIBAgFFBg0BBwKHaALBU4ZCBJgCi18 X-IronPort-AV: E=Sophos;i="4.67,315,1309730400"; d="scan'208";a="114934752" Received: from 0405ds1-vaer.0.fullrate.dk (HELO fw.fugmann.net) ([90.184.183.197]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 04 Aug 2011 09:58:18 +0200 Received: from [10.0.1.142] (unknown [87.54.60.37]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by fw.fugmann.net (Postfix) with ESMTPSA id EA49940017; Thu, 4 Aug 2011 09:58:16 +0200 (CEST) Message-ID: <4E3A5109.9030002@fugmann.net> Date: Thu, 04 Aug 2011 09:58:01 +0200 From: Anders Fugmann User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110626 Iceowl/1.0b2 Icedove/3.1.11 MIME-Version: 1.0 To: Gabriel Scherer CC: Martin Jambon , caml-list@inria.fr References: <4E37EBA3.6040800@fugmann.net> <4E386A65.8080000@ens-lyon.org> <4E38E4F8.6020300@fugmann.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Validation-by: anders@fugmann.net Subject: Re: [Caml-list] filename and line number. 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