Add some basic error handling

This commit is contained in:
Paul Brinkmeier
2025-08-21 23:40:32 +02:00
parent b264b50b01
commit 4c5ff2f319
5 changed files with 127 additions and 64 deletions
+4 -1
View File
@@ -1,4 +1,4 @@
module Yore.Log (info) where
module Yore.Log (Yore.Log.error, info) where
import Data.Time (getZonedTime)
import GHC.Stack (HasCallStack, SrcLoc (..), callStack, getCallStack)
@@ -7,6 +7,9 @@ import Text.Printf (printf)
info :: (HasCallStack) => String -> IO ()
info = doLog "INF"
error :: (HasCallStack) => String -> IO ()
error = doLog "ERR"
doLog :: (HasCallStack) => String -> String -> IO ()
doLog level msg = do
now <- getZonedTime