aboutsummaryrefslogtreecommitdiff
path: root/hsm-core/Hsm/Core/Log.hs
diff options
context:
space:
mode:
Diffstat (limited to 'hsm-core/Hsm/Core/Log.hs')
-rw-r--r--hsm-core/Hsm/Core/Log.hs27
1 files changed, 0 insertions, 27 deletions
diff --git a/hsm-core/Hsm/Core/Log.hs b/hsm-core/Hsm/Core/Log.hs
deleted file mode 100644
index 6930e90..0000000
--- a/hsm-core/Hsm/Core/Log.hs
+++ /dev/null
@@ -1,27 +0,0 @@
-module Hsm.Core.Log
- ( withLogIO
- , logTup
- , flushLogger
- ) where
-
-import Data.Aeson.Types (emptyObject)
-import Data.Text (Text)
-import Data.Time.Clock (getCurrentTime)
-import Effectful (Eff, (:>))
-import Effectful.Dispatch.Static (unsafeEff_)
-import Effectful.Log qualified as L
-
--- Helper function allows logging within IO, Useful during `resourcet`
--- allocation and release operations.
-withLogIO :: L.Log :> es => Eff es (L.LogLevel -> Text -> IO ())
-withLogIO = do
- logIO <- L.getLoggerIO
- return $ \level message -> do
- now <- getCurrentTime
- logIO now level message emptyObject
-
-logTup :: L.Log :> es => (L.LogLevel, Text) -> Eff es ()
-logTup (level, message) = L.logMessage level message emptyObject
-
-flushLogger :: L.Log :> es => Eff es ()
-flushLogger = L.getLoggerEnv >>= unsafeEff_ . L.waitForLogger . L.leLogger