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
open Color
type level =
| Trace
| Info
| Warning
| Error
let level_to_string l =
match l with
| Trace -> "Trace"
| Info -> "Info"
| Warning -> "Warn"
| Error -> "Error"
let level_to_upper_string l =
match l with
| Trace -> "TRACE"
| Info -> "INFO"
| Warning -> "WARN"
| Error -> "ERROR"
let level_to_color l =
match l with
| Trace -> Default
| Info -> Green
| Warning -> Yellow
| Error -> Red