Global.MakeThis function can be called to generate logging modules with the Log.t lazily instantiated, and prepopulated in the arguments.
val log : Log.t Core.Lazy.tval copy :
?level:Level.t ->
?on_error:[ `Call of Core.Error.t -> unit | `Raise ] ->
?output:Output.t list ->
?extra_tags:(string * string) list ->
unit ->
Log.tMake a copy of this log, with potentially some settings changed, or potentially extra tags added to each line.
val level : unit -> Level.tval set_level : Level.t -> unitval set_output : Output.t list -> unitval get_output : unit -> Output.t listval set_on_error : [ `Raise | `Call of Core.Error.t -> unit ] -> unitval get_time_source : unit -> Async_kernel.Synchronous_time_source.tval set_time_source :
[> Core.read ] Async_kernel.Synchronous_time_source.T1.t ->
unitmodule Transform : sig ... endval set_transform : (Message_event.t -> Message_event.t option) option -> unitval get_transform : unit -> (Message_event.t -> Message_event.t option) optionval would_log : Level.t option -> boolval set_level_via_param : ?default:Level.t -> unit -> unit Core.Command.Param.tSets the global log level via a flag, if provided.
If default is not provided, the existing log level will be unchanged if the flag is not provided.
Functions that operate on a given log. In this case they operate on a single log global to the module.
val raw :
?time:Core.Time_float.t ->
?tags:(string * string) list ->
('a, unit, string, unit) Core.format4 ->
'aval info :
?time:Core.Time_float.t ->
?tags:(string * string) list ->
('a, unit, string, unit) Core.format4 ->
'aval error :
?time:Core.Time_float.t ->
?tags:(string * string) list ->
('a, unit, string, unit) Core.format4 ->
'aval debug :
?time:Core.Time_float.t ->
?tags:(string * string) list ->
('a, unit, string, unit) Core.format4 ->
'aval flushed : unit -> unit Async_kernel.Deferred.tval printf :
?level:Level.t ->
?time:Core.Time_float.t ->
?tags:(string * string) list ->
('a, unit, string, unit) Core.format4 ->
'aGeneralized printf-style logging.
Sexp logging for messages at each log level or raw (no level) messages. Raw messages still include a timestamp
val raw_s :
?time:Core.Time_float.t ->
?tags:(string * string) list ->
Core.Sexp.t ->
unitval info_s :
?time:Core.Time_float.t ->
?tags:(string * string) list ->
Core.Sexp.t ->
unitval error_s :
?time:Core.Time_float.t ->
?tags:(string * string) list ->
Core.Sexp.t ->
unitval debug_s :
?time:Core.Time_float.t ->
?tags:(string * string) list ->
Core.Sexp.t ->
unitval sexp :
?level:Level.t ->
?time:Core.Time_float.t ->
?tags:(string * string) list ->
Core.Sexp.t ->
unitGeneralized sexp-style logging.
val string :
?level:Level.t ->
?time:Core.Time_float.t ->
?tags:(string * string) list ->
string ->
unitLog a string directly.
val structured_message :
?level:Level.t ->
?time:Core.Time_float.t ->
?tags:(string * string) list ->
Ppx_log_types.Message_data.t ->
Ppx_log_types.Message_source.t ->
unitval message : Message.t -> unitLog a pre-created message.
val message_event : Message_event.t -> unitval surround_s :
on_subsequent_errors:[ `Call of exn -> unit | `Log | `Raise ] ->
?level:Level.t ->
?time:Core.Time_float.t ->
?tags:(string * string) list ->
Core.Sexp.t ->
(unit -> 'a Async_kernel.Deferred.t) ->
'a Async_kernel.Deferred.tsurround t message f logs message and a UUID once before calling f and again after f returns or raises. If f raises, the second message will include the exception, and surround itself will re-raise the exception tagged with message. on_subsequent_errors is passed to the internal monitor as rest argument. As usual, the logging happens only if level exceeds the minimum level of t.
val surroundf :
on_subsequent_errors:[ `Call of exn -> unit | `Log | `Raise ] ->
?level:Level.t ->
?time:Core.Time_float.t ->
?tags:(string * string) list ->
('a,
unit,
string,
(unit -> 'b Async_kernel.Deferred.t) ->
'b Async_kernel.Deferred.t)
Core.format4 ->
'amodule For_testing : sig ... endmodule For_async_shutdown : sig ... endUsed internally by other Async libraries.