-- | Log functions using CallStack support in place of Template Haskell
--
-- @since 0.3.19
module Control.Monad.Logger.CallStack (
    module Log
  , logDebug
  , logInfo
  , logWarn
  , logError
  , logOther
  , logDebugSH
  , logInfoSH
  , logWarnSH
  , logErrorSH
  , logOtherSH
  ) where

import           Control.Monad.Logger as Log hiding (logDebug, logDebugSH,
                                              logError, logErrorSH, logInfo,
                                              logInfoSH, logOther, logOtherSH,
                                              logWarn, logWarnSH)
import           Data.Text            (Text)
import qualified Data.Text            as Text
import           GHC.Stack

-- | Logs a message with the location provided by
-- an implicit 'CallStack'.
--
-- @since 0.3.19
logDebug :: (HasCallStack, Log.MonadLogger m) => Text -> m ()
logDebug :: forall (m :: * -> *). (HasCallStack, MonadLogger m) => Text -> m ()
logDebug = forall (m :: * -> *). MonadLogger m => CallStack -> Text -> m ()
Log.logDebugCS HasCallStack => CallStack
callStack

-- | See 'logDebug'
--
-- @since 0.3.19
logInfo :: (HasCallStack, Log.MonadLogger m) => Text -> m ()
logInfo :: forall (m :: * -> *). (HasCallStack, MonadLogger m) => Text -> m ()
logInfo = forall (m :: * -> *). MonadLogger m => CallStack -> Text -> m ()
Log.logInfoCS HasCallStack => CallStack
callStack

-- | See 'logDebug'
--
-- @since 0.3.19
logWarn :: (HasCallStack, Log.MonadLogger m) => Text -> m ()
logWarn :: forall (m :: * -> *). (HasCallStack, MonadLogger m) => Text -> m ()
logWarn = forall (m :: * -> *). MonadLogger m => CallStack -> Text -> m ()
Log.logWarnCS HasCallStack => CallStack
callStack

-- | See 'logDebug'
--
-- @since 0.3.19
logError :: (HasCallStack, Log.MonadLogger m) => Text -> m ()
logError :: forall (m :: * -> *). (HasCallStack, MonadLogger m) => Text -> m ()
logError = forall (m :: * -> *). MonadLogger m => CallStack -> Text -> m ()
Log.logErrorCS HasCallStack => CallStack
callStack

-- | See 'logDebug'
--
-- @since 0.3.25
logOther :: (HasCallStack, Log.MonadLogger m) => Log.LogLevel -> Text -> m ()
logOther :: forall (m :: * -> *).
(HasCallStack, MonadLogger m) =>
LogLevel -> Text -> m ()
logOther = forall (m :: * -> *).
MonadLogger m =>
CallStack -> LogLevel -> Text -> m ()
Log.logOtherCS HasCallStack => CallStack
callStack

-- | Logs a showable value with the location provided by
-- an implicit 'CallStack'.
--
-- @since 0.3.25
logDebugSH :: (HasCallStack, Log.MonadLogger m, Show a) => a -> m ()
logDebugSH :: forall (m :: * -> *) a.
(HasCallStack, MonadLogger m, Show a) =>
a -> m ()
logDebugSH = forall (m :: * -> *). MonadLogger m => CallStack -> Text -> m ()
Log.logDebugCS HasCallStack => CallStack
callStack forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Text
Text.pack forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> String
show

-- | See 'logDebugSH'
--
-- @since 0.3.25
logInfoSH :: (HasCallStack, Log.MonadLogger m, Show a) => a -> m ()
logInfoSH :: forall (m :: * -> *) a.
(HasCallStack, MonadLogger m, Show a) =>
a -> m ()
logInfoSH = forall (m :: * -> *). MonadLogger m => CallStack -> Text -> m ()
Log.logInfoCS HasCallStack => CallStack
callStack forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Text
Text.pack forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> String
show

-- | See 'logDebugSH'
--
-- @since 0.3.25
logWarnSH :: (HasCallStack, Log.MonadLogger m, Show a) => a -> m ()
logWarnSH :: forall (m :: * -> *) a.
(HasCallStack, MonadLogger m, Show a) =>
a -> m ()
logWarnSH = forall (m :: * -> *). MonadLogger m => CallStack -> Text -> m ()
Log.logWarnCS HasCallStack => CallStack
callStack forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Text
Text.pack forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> String
show

-- | See 'logDebugSH'
--
-- @since 0.3.25
logErrorSH :: (HasCallStack, Log.MonadLogger m, Show a) => a -> m ()
logErrorSH :: forall (m :: * -> *) a.
(HasCallStack, MonadLogger m, Show a) =>
a -> m ()
logErrorSH = forall (m :: * -> *). MonadLogger m => CallStack -> Text -> m ()
Log.logErrorCS HasCallStack => CallStack
callStack forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Text
Text.pack forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> String
show

-- | See 'logDebugSH'
--
-- @since 0.3.25
logOtherSH :: (HasCallStack, Log.MonadLogger m, Show a) => Log.LogLevel -> a -> m ()
logOtherSH :: forall (m :: * -> *) a.
(HasCallStack, MonadLogger m, Show a) =>
LogLevel -> a -> m ()
logOtherSH LogLevel
lvl = forall (m :: * -> *).
MonadLogger m =>
CallStack -> LogLevel -> Text -> m ()
Log.logOtherCS HasCallStack => CallStack
callStack LogLevel
lvl forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Text
Text.pack forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> String
show