From: Ian Jackson Subject: RE: [PATCH] tools: ocaml: fix the logging in the ocaml libxl bindings Date: Mon, 4 Apr 2011 16:29:39 +0100 Message-ID: <19865.58339.522444.360814@mariner.uk.xensource.com> References: <67525892e2c6ee27c254.1300913609@ely> <19860.49534.110558.18863@mariner.uk.xensource.com> <81A73678E76EA642801C8F2E4823AD21956019EF03@LONPMAILBOX01.citrite.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <81A73678E76EA642801C8F2E4823AD21956019EF03@LONPMAILBOX01.citrite.net> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Dave Scott Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org Dave Scott writes ("RE: [Xen-devel] [PATCH] tools: ocaml: fix the logging in the ocaml libxl bindings"): > That is indeed the current behaviour -- most log messages end up dropped, > only those which are in the buffer when the libxl call fails get bubbled > up to the user in an exception. The main difference after my patch is > that the code nolonger segfaults after calling (IIRC) gettopologyinfo > and hopefully won't blow its buffer if the logging ever gets spammy :-) Right :-). Fair enough. > If you recommend changing the policy to always record/handle all log > messages then that sounds fine to me. From the point of view of the > ocaml code I can think of the following options (Vincent: do you have any > advice?): I think the ocaml bindings to libxl should expose the actual interface of libxl, without messing with the semantics of errors in this way. I don't know which of these: > 1. add the notion of a per-call context to the ocaml and associate > logging callbacks with this. The ocaml code can then do whatever it > likes on a per-call basis. > > 2. allow the ocaml to set a global logging callback which would handle > logging from all ocaml xl calls in the same process > > 3. allow the ocaml to set some syslog logging parameters so all ocaml xl > calls would just log via syslog ... would be more sensible from an ocaml point of view. Ian.