module Messages:
| Parameters: |
|
val verbose : ?notreally:bool ->
?chan:Pervasives.out_channel ->
?flush:bool ->
?nl:bool ->
?initial:bool ->
?myself:string option ->
int -> ('a, unit, string, unit) Pervasives.format4 -> 'averbose ?chan ?flush ?nl ?initial ?myself level fmt ...: print
verbose messages.
The VERBOSITY module controls the printing of the message with an int. If
level <= V.get (), the message is printed, so higher values print more verbose messages.
notreally : if true, precede message with "NOT: " (default: false)chan : channel on which to print (default: stderr)flush : if true, flush chan after each printing (default: true)nl : if true, print a newline after each message (default: true)initial : if true, prepend message with myself (default: true)myself : name of application (default: M.myself)level : the verbosity level of this messagefmt : format string as per Printf.printfval verbosely : (?notreally:bool ->
?chan:Pervasives.out_channel ->
?flush:bool ->
?nl:bool ->
?initial:bool ->
?myself:string option ->
int ->
(string -> string -> string -> unit, unit, string, unit) Pervasives.format4 ->
string -> string -> string -> unit) ->
int ->
string ->
?after:string -> ?printexc:(exn -> string) -> ('a -> 'b) -> 'a -> 'bverbosely v level what f x: return f x, with a verbose message before and after the evaluation.
Typically, you will partially apply verbosely to a verbose function:
let verbosely = verbosely verbose
and then call that.f xlevel : the verbosity level of this messagewhat : the message describing what is happeningafter : post-evaluation suffixprintexc : function to convert any exception raised in the evaluation of f x to a string (default: Printexc.to_string)f : the functionx : the parameterval warning : ?chan:Pervasives.out_channel ->
?myself:string option ->
?fatal:bool -> ('a, unit, string, unit) Pervasives.format4 -> 'awarning ?chan ?myself fmt ...: print a warning
(i.e. non-fatal) message on chan.
The message is prefixed with the application's name (myself), terminated with a newline,
and flushed.
chan : channel on which to print (default: stderr)myself : name of application (default: M.myself)fmt : format string as per Printf.printfval fatal : ?chan:Pervasives.out_channel ->
?myself:string option ->
?status:int -> ('a, unit, string, 'b) Pervasives.format4 -> 'afatal ?myself ?status fmt ...: print a fatal error message on
chan, terminating the application.
The message is prefixed with the application's name (myself), terminated with a newline,
and flushed.
chan : channel on which to print (default: stderr)myself : name of application (default: M.myself)status : exit status (default: 1)fmt : format string as per Printf.printfval dryrot : ?chan:Pervasives.out_channel ->
?myself:string option ->
?status:int -> ?bt:bool -> ('a, unit, string, 'b) Pervasives.format4 -> 'adryrot ?myself ?status ?bt fmt ...: print a dryrot error
message on chan, terminating the application.
This is equivalent to a failed assertion.
The message is prefixed with the application's name (myself) and the string "DRYROT",
terminated with a newline, and flushed.
chan : channel on which to print (default: stderr)myself : name of application (default: M.myself)status : exit status (default: 3)bt : print a backtrace (default: false)fmt : format string as per Printf.printfval hdl : ?myself:string option -> 'a -> ('b -> 'c) -> 'b -> 'chdl ?myself interface f x: apply f to x, catching all exceptions
defined in Kwapp and terminating the program with an appropriate
error message.
Typical usage is to wrap it around your main function, e.g.
let main () = ...
let () = Messages.hdl main ()
myself : name of application (default: M.myself)interface : the application interfacef : the functionx : the value