Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: -- (:)
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

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: