xlog/lib/core.ml

25 lines
543 B
OCaml

type level =
| TRACE (* 0 *)
| DEBUG (* 1 *)
| INFO (* 2 *)
| WARN (* 3 *)
| ERROR (* 4 *)
external int_of_level : level -> int = "%identity"
type writer =
ts:Time.t ->
ns:string ->
filename:string ->
lineno:int ->
func:string ->
errno:int ->
exn:((exn * Printexc.raw_backtrace) option) ->
lvl:level ->
string ->
unit
let ( +++ ) w1 w2 ~ts ~ns ~filename ~lineno ~func ~errno ~exn ~lvl msg =
w1 ~ts ~ns ~filename ~lineno ~func ~errno ~exn ~lvl msg;
w2 ~ts ~ns ~filename ~lineno ~func ~errno ~exn ~lvl msg