Module Bap_main_event.Log

Logging Events

type level =
  1. | Debug
  2. | Info
  3. | Warning
  4. | Error

predefined log levels

type info = {
  1. level : level;
    (*

    the event importance

    *)
  2. section : string;
    (*

    the event section, e.g., plugin name

    *)
  3. message : string;
    (*

    the actual message

    *)
}

each logging message carries this inforamtion

type event +=
  1. | Message of info
type event +=
  1. | Progress of {
    1. task : string;
      (*

      the task name

      *)
    2. note : string option;
      (*

      an additional note

      *)
    3. stage : int option;
      (*

      the current stage

      *)
    4. total : int option;
      (*

      the total number of stages

      *)
    }

the progress bar message

val progress : ?note:string -> ?stage:int -> ?total:int -> string -> unit

progress message sends the progress report message.

See the report_progress function for the detailed description.

val message : level -> section:string -> ('a, Stdlib.Format.formatter, unit) Stdlib.format -> 'a

message level ~section "my message: %s" "hello" constructs and sends the logging message.

module Create () : sig ... end

generates reporters specialized to the current plugin.