From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id CAA32420; Thu, 15 Jul 2004 02:18:01 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id CAA31636; Thu, 15 Jul 2004 02:17:59 +0200 (MET DST) Received: from fichte.ai.univie.ac.at (fichte.ai.univie.ac.at [131.130.174.156]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i6F0HwEV017635; Thu, 15 Jul 2004 02:17:59 +0200 Received: from fichte.ai.univie.ac.at (markus@localhost [127.0.0.1]) by fichte.ai.univie.ac.at (8.12.3/8.12.3/Debian-6.6) with ESMTP id i6F0HwDu005821; Thu, 15 Jul 2004 02:17:58 +0200 Received: (from markus@localhost) by fichte.ai.univie.ac.at (8.12.3/8.12.3/Debian-6.6) id i6F0Hw7c005820; Thu, 15 Jul 2004 02:17:58 +0200 Date: Thu, 15 Jul 2004 02:17:58 +0200 From: Markus Mottl To: Pierre Weis Cc: caml-list@inria.fr Subject: Re: [Caml-list] kprintf with user formatters Message-ID: <20040715001758.GF26614@fichte.ai.univie.ac.at> Mail-Followup-To: Pierre Weis , caml-list@inria.fr References: <20040630183237.457317c7@mostha> <200407142110.XAA25344@pauillac.inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200407142110.XAA25344@pauillac.inria.fr> User-Agent: Mutt/1.5.6i X-Miltered: at nez-perce with ID 40F5CD36.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 kprintf:01 formatters:01 pierre:01 weis:01 printf:01 fmt:01 fmt:01 printf:01 ips:99 debug:01 mottl:02 mottl:02 wrote:03 btw:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, 14 Jul 2004, Pierre Weis wrote: > Your problem is thus that the function Debug.printf is not the right > one (since it has not the right type :) Btw., since we are at it: I'd like to use my own printers depending on a conditional, e.g.: let log level fmt = if may_log level then kfprintf ... else ??? If the given log level "level" does not allow logging the message specified by "fmt", I just want to ignore the parameters provided together with "fmt" - but how? Is there some (safe) trick, or do I have to write my own Printf/Format-modules? I don't want to waste computation time by unnecessarily converting format arguments to strings, which may be very costly, e.g. when this would mean converting IPs to hostnames, etc. Regards, Markus -- Markus Mottl http://www.oefai.at/~markus markus@oefai.at ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners