diff options
author | Paul Oliver <contact@pauloliver.dev> | 2025-02-07 17:10:05 +0000 |
---|---|---|
committer | Paul Oliver <contact@pauloliver.dev> | 2025-02-24 20:00:47 +0000 |
commit | c123795a0d9588f40f06dba918bb0130944302ec (patch) | |
tree | 61161cddf1ed08fcb18724bf2a642cfafe94c5a2 /hsm-log/Hsm/Log.hs |
Initial
Diffstat (limited to 'hsm-log/Hsm/Log.hs')
-rw-r--r-- | hsm-log/Hsm/Log.hs | 15 |
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] |