aboutsummaryrefslogtreecommitdiff
path: root/src/Logger.hs
blob: 6faa482c39ecb5ffdd1077e784d1dc6667d67d8c (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 Time (formatCurrentLocale)

info :: Text -> IO ()
info message = do
  time <- formatCurrentLocale "[%d/%m/%Y, %H:%M]"
  T.appendFile "logs" $
    T.concat
      [ time
      , " - "
      , message
      , "\n"
      ]