create f
returns a t, given a function that actually performs the final output
work. It is the responsibility of the write function to contain all state, and to
clean up after itself when it is garbage collected (which may require a finalizer).
The function should avoid modifying the contents of the queue; it's reused for each
Output.t
.
The "stock" output modules support a sexp and bin_prot output format, and other output modules should make efforts to support them as well where it is meaningful/appropriate to do so.
The unit Deferred returned by the function should not be fulfilled until the all of the messages in the given queue are completely handled (e.g. written to disk).
An optional rotate
function may be given which will be called when Log.rotate t
is called while this output is in effect. This is useful for programs that want
very precise control over rotation.
See Async_extended.Std.Log for syslog and colorized console output.