aboutsummaryrefslogtreecommitdiff
path: root/hsm-log/Hsm/Log.hs
diff options
context:
space:
mode:
authorPaul Oliver <contact@pauloliver.dev>2025-02-07 17:10:05 +0000
committerPaul Oliver <contact@pauloliver.dev>2025-02-18 20:35:35 +0000
commitab4591cb0e074ce98c24645cdb80cb5012aed566 (patch)
tree98451fa7e042e49ea83f265866754f3f6a3b406f /hsm-log/Hsm/Log.hs
InitialHEADmaster
Diffstat (limited to 'hsm-log/Hsm/Log.hs')
-rw-r--r--hsm-log/Hsm/Log.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/hsm-log/Hsm/Log.hs b/hsm-log/Hsm/Log.hs
new file mode 100644
index 0000000..0f388be
--- /dev/null
+++ b/hsm-log/Hsm/Log.hs
@@ -0,0 +1,15 @@
+{-# LANGUAGE OverloadedStrings #-}
+
+module Hsm.Log
+ ( logMsg
+ ) where
+
+import Data.Text qualified as T
+import Data.Text.IO qualified as T
+import Data.Time.Clock (getCurrentTime)
+import Data.Time.ISO8601 (formatISO8601Millis)
+
+logMsg :: [T.Text] -> T.Text -> IO ()
+logMsg domain msg = do
+ time <- T.pack . formatISO8601Millis <$> getCurrentTime
+ T.putStrLn $ T.unwords [time, "[" <> T.intercalate "/" domain <> "]", msg]