{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
module Imm.Logger where
import Imm.Prelude
import Imm.Pretty
data Handle m = Handle
{ log :: LogLevel -> Doc AnsiStyle -> m ()
, getLogLevel :: m LogLevel
, setLogLevel :: LogLevel -> m ()
, setColorizeLogs :: Bool -> m ()
, flushLogs :: m ()
}
data LogLevel = Debug | Info | Warning | Error
deriving(Eq, Ord, Read, Show)
instance Pretty LogLevel where
pretty Debug = "DEBUG"
pretty Info = "INFO"
pretty Warning = "WARNING"
pretty Error = "ERROR"