module Control.Monad.Logger.CallStack (
module Log
, logDebug
, logInfo
, logWarn
, logError
) where
import Control.Monad.Logger as Log hiding (logDebug, logError,
logInfo, logOther, logWarn)
import Data.Text (Text)
import qualified Data.Text as Text
import GHC.Stack
logDebug :: (HasCallStack, Log.MonadLogger m) => Text -> m ()
logDebug = Log.logDebugCS callStack
logInfo :: (HasCallStack, Log.MonadLogger m) => Text -> m ()
logInfo = Log.logInfoCS callStack
logWarn :: (HasCallStack, Log.MonadLogger m) => Text -> m ()
logWarn = Log.logWarnCS callStack
logError :: (HasCallStack, Log.MonadLogger m) => Text -> m ()
logError = Log.logErrorCS callStack
logOther :: (HasCallStack, Log.MonadLogger m) => Log.LogLevel -> Text -> m ()
logOther = Log.logOtherCS callStack
logDebugSH :: (HasCallStack, Log.MonadLogger m, Show a) => a -> m ()
logDebugSH = Log.logDebugCS callStack . Text.pack . show
logInfoSH :: (HasCallStack, Log.MonadLogger m, Show a) => a -> m ()
logInfoSH = Log.logInfoCS callStack . Text.pack . show
logWarnSH :: (HasCallStack, Log.MonadLogger m, Show a) => a -> m ()
logWarnSH = Log.logWarnCS callStack . Text.pack . show
logErrorSH :: (HasCallStack, Log.MonadLogger m, Show a) => a -> m ()
logErrorSH = Log.logErrorCS callStack . Text.pack . show
logOtherSH :: (HasCallStack, Log.MonadLogger m, Show a) => Log.LogLevel -> a -> m ()
logOtherSH lvl = Log.logOtherCS callStack lvl . Text.pack . show