0 | module Util.Eff
 1 |
 2 | import Control.Eff
 3 | import Text.ANSI
 4 |
 5 | -----------------------
 6 | -- Logging Utilities --
 7 | -----------------------
 8 | namespace Logging
 9 |   export
10 |   info : Has (WriterL "log" String) fs => String -> Eff fs ()
11 |   info str =
12 |     let tag = show . bolden . show . colored Green $ "[INFO]"
13 |     in tellAt "log" (tag ++ ": " ++ str ++ "\n")
14 |
15 |   export
16 |   debug : Has (WriterL "log" String) fs => String -> Eff fs ()
17 |   debug str =
18 |     let tag = show . bolden . show . colored BrightWhite $ "[DEBUG]"
19 |     in tellAt "log" (tag ++ ": " ++ str ++ "\n")
20 |
21 |   export
22 |   warn : Has (WriterL "log" String) fs => String -> Eff fs ()
23 |   warn str =
24 |     let tag = show . bolden . show . colored Yellow $ "[WARN]"
25 |     in tellAt "log" (tag ++ ": " ++ str ++ "\n")
26 |