xlog/lib/core.ml

25 lines
543 B
OCaml
Raw Normal View History

2024-04-23 02:36:13 +00:00
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) ->
2024-04-23 02:36:13 +00:00
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