Module Core_extended.Logger

type message = [ `Fatal | `Error | `Warn | `Info | `Debug ] * string
type size = [
| `Kb of int64
| `Mb of int64
| `Unlimited
]
type 'messagetype t
type default_t = message t
val create : ?⁠max_size:size ‑> ?⁠mode:Core.Unix.file_perm ‑> ?⁠max_archives:[ `Max of int | `Unlimited ] ‑> ?⁠full_callback:(string Core.Squeue.t ‑> unit) ‑> ?⁠filter:('messagetype ‑> bool) ‑> message_to_string:('messagetype ‑> string) ‑> string ‑> 'messagetype t
val create_default : ?⁠max_size:size ‑> ?⁠mode:Core.Unix.file_perm ‑> ?⁠max_archives:[ `Max of int | `Unlimited ] ‑> ?⁠full_callback:(string Core.Squeue.t ‑> unit) ‑> string ‑> message t

creates a log using the default message type and a filter that drops `Debug messages

val log : 'messagetype t ‑> 'messagetype ‑> unit

logs a message to log

val filter : 'messagetype t ‑> ('messagetype ‑> bool) ‑> unit

Sets the filter for a log

val clear_filter : 'messagetype t ‑> unit

removes the filter from a log

misc helper functions

val maybe_log : 'messagetype t option ‑> 'messagetype ‑> unit

logs a message to Some log, returns silently if log is None

val timestamp : unit ‑> string

Returns a timestamp as a string suitable for log files