Initial commit
This commit is contained in:
commit
2255e73949
9 changed files with 373 additions and 0 deletions
26
src/Util/Eff.idr
Normal file
26
src/Util/Eff.idr
Normal file
|
@ -0,0 +1,26 @@
|
|||
module Util.Eff
|
||||
|
||||
import Control.Eff
|
||||
import Text.ANSI
|
||||
|
||||
-----------------------
|
||||
-- Logging Utilities --
|
||||
-----------------------
|
||||
namespace Logging
|
||||
export
|
||||
info : Has (WriterL "log" String) fs => String -> Eff fs ()
|
||||
info str =
|
||||
let tag = show . bolden . show . colored Green $ "[INFO]"
|
||||
in tellAt "log" (tag ++ ": " ++ str ++ "\n")
|
||||
|
||||
export
|
||||
debug : Has (WriterL "log" String) fs => String -> Eff fs ()
|
||||
debug str =
|
||||
let tag = show . bolden . show . colored BrightWhite $ "[DEBUG]"
|
||||
in tellAt "log" (tag ++ ": " ++ str ++ "\n")
|
||||
|
||||
export
|
||||
warn : Has (WriterL "log" String) fs => String -> Eff fs ()
|
||||
warn str =
|
||||
let tag = show . bolden . show . colored Yellow $ "[WARN]"
|
||||
in tellAt "log" (tag ++ ": " ++ str ++ "\n")
|
Loading…
Add table
Add a link
Reference in a new issue