Library
Module
Module type
Parameter
Class
Class type
create path
creates a new log file at temporary location path
. Call finish
when done to release the file descriptor.
finish t
marks log t
as finished. If it was open for writing, this closes the file descriptor. It cannot be used after this (for reading or writing), although existing background operations (e.g. tail
) can continue successfully.
printf t fmt
is a wrapper for write t
that takes a format string.
val empty : t
empty
is a read-only log with no content.
val tail :
?switch:Lwt_switch.t ->
t ->
(string -> unit) ->
(unit, [> `Cancelled ]) Lwt_result.t
tail t dst
streams data from the log to dst
. This can be called at any time before finish
is called.
val copy : src:Lwt_unix.file_descr -> dst:t -> unit Lwt.t
copy ~src ~dst
reads bytes from the src
file descriptor and writes them to the build log dst
.