blob: 4be55be4e001a3af153d3486cbda3c9551f781c4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
{-# LANGUAGE OverloadedStrings #-}
module Logger
( info
) where
import Data.Text (Text)
import qualified Data.Text as T
import qualified Data.Text.IO as T (appendFile)
import Data.Time.LocalTime (getZonedTime)
import Data.Time.Format (formatTime, defaultTimeLocale)
info :: Text -> IO ()
info message = do
time <- T.pack <$> formatTime defaultTimeLocale "[%d/%m/%Y, %H:%M]" <$> getZonedTime
T.appendFile "logs" $
T.concat
[ time
, " - "
, message
, "\n"
]
|