package bistro

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file logger.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
open Bistro_internals

type time = float

type event =
  | Workflow_ready : _ Workflow.t -> event
  | Workflow_started : _ Workflow.t * Allocator.resource -> event
  | Workflow_ended : {
      outcome : Task_result.t ;
      start : time ;
      _end_ : time ;
    } -> event
  | Workflow_skipped : _ Workflow.t * [ `Done_already | `Missing_dep ] -> event
  | Workflow_allocation_error : _ Workflow.t * string -> event
  | Workflow_collected : _ Workflow.t -> event
  | Singularity_image_collected : Command.container_image -> event
  | Debug : string -> event

class type t = object
  method event : Db.t -> time -> event -> unit
  method stop : unit Lwt.t
end

let null = object
  method event _ _ _ = ()
  method stop = Lwt.return ()
end

let tee loggers = object
  method event x y z =
    List.iter (fun l -> l#event x y z) loggers

  method stop =
    Lwt.join (List.map (fun l -> l#stop) loggers)
end
OCaml

Innovation. Community. Security.