From 4711772a541a601920060587dc3a4450c6421efb Mon Sep 17 00:00:00 2001 From: favonia Date: Fri, 22 Sep 2023 12:30:28 -0500 Subject: [PATCH] docs(Logger): tweaks --- src/LoggerSigs.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LoggerSigs.ml b/src/LoggerSigs.ml index 52a007e..4c02ae1 100644 --- a/src/LoggerSigs.ml +++ b/src/LoggerSigs.ml @@ -135,7 +135,7 @@ sig val try_with : ?emit:(Code.t Diagnostic.t -> unit) -> ?fatal:(Code.t Diagnostic.t -> 'a) -> (unit -> 'a) -> 'a val register_printer : ([ `Emit of Code.t Diagnostic.t | `Fatal of Code.t Diagnostic.t ] -> string option) -> unit - (** [register_printer f] registers a printer [p] via {!val:Printexc.register_printer} to convert unhandled internal effects and exceptions into strings for the OCaml runtime system to display. Ideally, all internal effects and exceptions will be handled by {!val:run} and there is no need to use this function, but it could be useful for debugging when it is that the case. The functor {!module:Logger.Make} always registers a simple printer to suggest using {!val:run}, but you can register new ones to override it. The return type of the printer [p] should return [Some s] where [s] is the resulting string, or [None] if it chooses not to convert a particular effect or exception. The registered printers are tried in reverse order until one of them returns [Some s] for some [s]; that is, the last registered printer is tried first. Note that this function is a wrapper of {!val:Printexc.register_printer} and all the registered printers (via this function or {!val:Printexc.register_printer}) are put into the same list. + (** [register_printer f] registers a printer [p] via {!val:Printexc.register_printer} to convert unhandled internal effects and exceptions into strings for the OCaml runtime system to display. Ideally, all internal effects and exceptions should have been handled by {!val:run} and there is no need to use this function, but when it is not the case, this function can be helpful for debugging. The functor {!module:Logger.Make} always registers a simple printer to suggest using {!val:run}, but you can register new ones to override it. The return type of the printer [p] should return [Some s] where [s] is the resulting string, or [None] if it chooses not to convert a particular effect or exception. The registered printers are tried in reverse order until one of them returns [Some s] for some [s]; that is, the last registered printer is tried first. Note that this function is a wrapper of {!val:Printexc.register_printer} and all the registered printers (via this function or {!val:Printexc.register_printer}) are put into the same list. The input type of the printer [p] is a variant representation of all internal effects and exceptions used in this module: - [`Emit diag] corresponds to the effect triggered by {!val:emit}; and