Module Output

module Output: sig .. end
This module defines the concept of output, that is how an event is written to a channel. It is possible to register new outputs through the register function. Initially, two outputs are registered:


Definitions

class type impl = object .. end
The type of output objects, that is concrete implementation.
type rotation = {
   seconds_elapsed :float option; (*Number of seconds between two rotations.*)
   signal_caught :Signal.t option; (*Number of signal provoking a rotation.*)
}
The type of rotation conditions, rotation occurring when one of the conditions is met.
type t = string -> rotation -> Layout.t lazy_t -> impl 
The type of outputs, that is a function constructing an actual output implementation. The first parameter describes the output (e. g. filename), while the second one is an optional rotation value (e. g. time between two file switches). The exact semantics associated with both parameters is output-dependent. The third argument is the layout associated with the logger, it is needed to get header and footer (that can be necessary because some outputs may want to write them at each rotation.)
val register : string -> t -> unit
register n o registers the output o with name n, replacing any existing output with the same name.
val register_unnamed : t -> string
Similar to register except that an unused name is generated and returned.
val get : string -> t
get n returns the output registered with name n.

Raises Not_found if no output exists with the passed name.


Predefined outputs

val void : t
The output initially registered with the name "void". Discards all data; all three parameters being ignored.
val file : t
The output initially registered with the name "file". Uses bare files, writing header and footer at each rotation (if any). The rotation is given by the float parameter and is measured in seconds. The string parameter is essentially interpreted as a file name, except that: I/O errors are silently discarded (unless "BOLT_SILENT" is not set to either "YES" or "ON" - ignoring case).
val growlnotify : t
The output initially registered with the name "growlnotify". Sends the data to Growl through the growlnotify command-line utility.
val bell : t
The output initially registered with the name "bell". Discards all data, just writes the "bell" character on standard output.
val say : t
The output initially registered with the name "say". Actually says the data through the say command-line utility (MacOS X).