{-# LANGUAGE OverloadedStrings, TypeSynonymInstances, FlexibleInstances, ExistentialQuantification, TypeFamilies, GeneralizedNewtypeDeriving, StandaloneDeriving, MultiParamTypeClasses, UndecidableInstances, ScopedTypeVariables, FlexibleContexts #-}
module System.Log.Heavy.Shortcuts
(
reportError, warning, info, debug,
errorMessage, warnMessage, infoMessage, debugMessage
) where
import Control.Monad.Trans
import qualified Data.Text.Lazy as TL
import qualified Data.Text.Format.Heavy as F
import System.Log.Heavy.Types
import System.Log.Heavy.Level
import System.Log.Heavy.Util
infoMessage :: F.ClosedVarContainer vars => TL.Text -> vars -> LogMessage
infoMessage fmt vars = LogMessage info_level [] undefined fmt vars []
debugMessage :: F.ClosedVarContainer vars => TL.Text -> vars -> LogMessage
debugMessage fmt vars = LogMessage debug_level [] undefined fmt vars []
errorMessage :: F.ClosedVarContainer vars => TL.Text -> vars -> LogMessage
errorMessage fmt vars = LogMessage error_level [] undefined fmt vars []
warnMessage :: F.ClosedVarContainer vars => TL.Text -> vars -> LogMessage
warnMessage fmt vars = LogMessage warn_level [] undefined fmt vars []
debug :: forall m vars. (F.ClosedVarContainer vars, MonadIO m, HasLogging m) => TL.Text -> vars -> m ()
debug fmt vars = logMessage $ debugMessage fmt vars
info :: forall m vars. (F.ClosedVarContainer vars, MonadIO m, HasLogging m) => TL.Text -> vars -> m ()
info fmt vars = logMessage $ infoMessage fmt vars
reportError :: forall m vars. (F.ClosedVarContainer vars, MonadIO m, HasLogging m) => TL.Text -> vars -> m ()
reportError fmt vars = logMessage $ errorMessage fmt vars
warning :: forall m vars. (F.ClosedVarContainer vars, MonadIO m, HasLogging m) => TL.Text -> vars -> m ()
warning fmt vars = logMessage $ warnMessage fmt vars