Module type Log.CONFIG

The type of logging configurations.

val mode : Stdlib.open_flag

The mode used to open the log file if the destination is a Prelude.Log.dest.File.

Should be one of open_append or open_trunc.

val signal : int option

If (signal <> None) then Make.reopen will be called upon receipt of this signal.

Typically used for log rotation with Sys.sighup.

val timestamp : (unit -> string) option

A function that returns a timestamp that is printed as the first component of the log message.

The timestamp can be in any conceivable format (even one that's not a timestamp). You might use e.g. (Unix.time >> truncate >> string_of_int) for an unreadable but sortable timestamp; I would normally use (Unix.time >> Unix.localtime >> Time.(strftime w3c)).

val pid : (unit -> int) option

If (something pid) the integer is presumed to be the pid of this process and is appended to myself in the traditional syslog style.

The usual value would be (Some Unix.getpid).

Example: if (myself = Some "myself") and (pid = Some (k 100)), then the log message will contain "myself[100]".

val line : (string -> string) option

If (something line), this function will be applied to the text of the log message to quote any newlines, thus assuring that the log message will be one single line.

For example, you could simply convert newlines to spaces by using (String.replace "\n" " ").

Actually this function is simply composed with quote and can do anything you like.

val level : unit -> int

This function is called to determine the global log level.

For example, any of Message.(of_ref, env, zero, or one) would be suitable.

val myself : string option
val flush : bool
val sep : string
val quote : (string -> string) option