English version
Accueil     Ŕ propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis ŕ jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml ŕ l'adresse ocaml.org.

Browse thread
[Caml-list] kprintf with user formatters
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-07-15 (00:18)
From: Markus Mottl <markus@o...>
Subject: Re: [Caml-list] kprintf with user formatters
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 ...

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.


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