Module Asl

module Asl: sig .. end
Allow an application to log via the Apple System Log

The Apple System Log is intended to be a replacement for syslog on OSX systems.

Example:

  let client = Asl.Client.create ~ident:"example" ~facility:"Daemon" ~opts:[ `Stderr ] () in
  let message = Asl.Message.create ~sender:"example" () in
  Asl.log ~client message `Notice "hello, world!"

For context, please read the following documents:

  1. Apple System Log man pages


module Client: sig .. end
module Message: sig .. end
type level = [ `Alert | `Crit | `Debug | `Emerg | `Err | `Info | `Notice | `Warning ] 
Every message has an associated level, which is usually used for filtering.
val log : ?client:Client.t -> Message.t -> level -> string -> unit
Send a string to the logger with the given message context and level.

Creating a client is optional. If none is provided then a default thread-safe client is used. Note the internal locks can cause extra contention between threads. Note also the only way to have logs printed to stderr is to construct and use a Client.t.