Module IBase.Logging
include module type of Die
exceptionInferExternalError of stringexceptionInferInternalError of stringexceptionInferUserError of stringexceptionInferExit of intThis can be used to avoid scattering exit invocations all over the codebase
type error=|ExternalError|InternalError|UserErrorkind of error for
die, with similar semantics asLogging.{external,internal,user}_error
val exit : int -> 'aval exit_code_of_exception : IStdlib.IStd.Exn.t -> intval set_log_uncaught_exception_callback : (exn -> exitcode:int -> unit) -> unitval log_uncaught_exception : exn -> exitcode:int -> unitval die : error -> ('a, Stdlib.Format.formatter, unit, _) IStdlib.IStd.format4 -> 'aRaise the corresponding exception.
val raise_error : ?backtrace:IStdlib.IStd.Caml.Printexc.raw_backtrace -> error -> msg:string -> 'a
val term_styles_of_style : style -> IStdlib.IStd.ANSITerminal.style list
val environment_info : ('a, F.formatter, unit) IStdlib.IStd.format -> 'alog information about the environment
val progress : ('a, F.formatter, unit) IStdlib.IStd.format -> 'aprint immediately to standard error unless --quiet is specified
val log_task : ('a, F.formatter, unit) IStdlib.IStd.format -> 'alog progress in the log file and on the console unless there is an active task bar
val task_progress : f:(unit -> 'a) -> (F.formatter -> 'b -> unit) -> 'b -> 'atask_progress ~f pp xexecutesfand log progresspp xin the log file and also on the console unless there is an active task bar
val result : ('a, F.formatter, unit) IStdlib.IStd.format -> 'aEmit a result to stdout. Use only if the output format is stable and useful enough that it may conceivably get piped to another program, ie, almost never (use
progressinstead otherwise).
val user_error : ('a, F.formatter, unit) IStdlib.IStd.format -> 'abad input, etc. detected
val user_warning : ('a, F.formatter, unit) IStdlib.IStd.format -> 'aval internal_error : ('a, F.formatter, unit) IStdlib.IStd.format -> 'ahuho, infer has a bug
val external_error : ('a, F.formatter, unit) IStdlib.IStd.format -> 'asome other tool has a bug or is called wrongly
val external_warning : ('a, F.formatter, unit) IStdlib.IStd.format -> 'a
type debug_kind=|Analysis|BufferOverrun|Capture|Linters|MergeCapture|TestDeterminatortype debug_level=|Quietinnocuous, eg emitted once per toplevel execution
|Mediumstill fairly lightweight, eg emitted O(<number of infer processes>)
|Verbosego crazy
Level of verbosity for debug output. Each level enables all the levels before it.
val debug : debug_kind -> debug_level -> ('a, F.formatter, unit) IStdlib.IStd.format -> 'alog debug info
val debug_dev : ('a, Stdlib.Format.formatter, unit) IStdlib.IStd.format -> 'aFor debugging during development.
val ocaml_pos_to_string : ocaml_pos -> stringConvert an ocaml position to a string
val pp_ocaml_pos_opt : F.formatter -> ocaml_pos option -> unitPretty print a position in ocaml source
val setup_log_file : unit -> unitSet up logging to go to the log file. Call this once the results directory has been set up.
val reset_formatters : unit -> unitReset the formatters used for logging. Call this when you fork(2).
val d_pp : (F.formatter -> 'a -> unit) -> 'a -> unitval d_pp_with_pe : ?color:IStdlib.Pp.color -> (IStdlib.Pp.env -> F.formatter -> 'a -> unit) -> 'a -> unitval force_and_reset_delayed_prints : F.formatter -> unitval get_and_reset_delayed_prints : unit -> delayed_printsreturn the delayed print actions and reset them
val set_delayed_prints : delayed_prints -> unitset the delayed print actions
val d_str : ?color:IStdlib.Pp.color -> string -> unitdump a string
val d_strln : ?color:IStdlib.Pp.color -> string -> unitdump a string plus newline
val d_printf : ?color:IStdlib.Pp.color -> ('a, F.formatter, unit) IStdlib.IStd.format -> 'aval d_printfln : ?color:IStdlib.Pp.color -> ('a, F.formatter, unit) IStdlib.IStd.format -> 'aval d_printfln_escaped : ?color:IStdlib.Pp.color -> ('a, F.formatter, unit) IStdlib.IStd.format -> 'aval d_error : string -> unitdump an error string
val d_increase_indent : unit -> unitdump command to increase the indentation level. NOTE: most likely, you need
d_with_indentinstead
val d_decrease_indent : unit -> unitdump command to decrease the indentation level NOTE: most likely, you need
d_with_indentinstead.
val d_with_indent : ?pp_result:(F.formatter -> 'a -> unit) -> name:string -> (unit -> 'a) -> 'aExecute arbitrary function (the last argument) with a given
nameso that all logs written inside (if any) are written with indentation.pp_result, if provided, will make the result of a call to be printed as well (useful for cases when there are several places when the function returns).NOTE: If you want to use it NOT at the very top level of a function, it is a code smell, and you probably want to split your function into smaller ones.