Initial commit

This commit is contained in:
Nathan McCarty 2025-01-03 09:32:58 -05:00
commit 2255e73949
9 changed files with 373 additions and 0 deletions

26
src/Util/Eff.idr Normal file
View 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")