-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | A class of monads which can log messages.
--   
--   See README and Haddocks at
--   https://www.stackage.org/package/monad-logger
@package monad-logger
@version 0.3.42

-- | This module provides the facilities needed for a decoupled logging
--   system.
--   
--   The MonadLogger class is implemented by monads that give access
--   to a logging facility. If you're defining a custom monad, then you may
--   define an instance of MonadLogger that routes the log messages
--   to the appropriate place (e.g., that's what yesod-core's
--   HandlerT does). Otherwise, you may use the LoggingT
--   monad included in this module (see runStderrLoggingT). To
--   simply discard log message, use NoLoggingT.
--   
--   As a user of the logging facility, we provide you some convenient
--   Template Haskell splices that use the MonadLogger class. They
--   will record their source file and position, which is very helpful when
--   debugging. See logDebug for more information.
module Control.Monad.Logger

-- | A Monad which has the ability to log messages in some manner.
class Monad m => MonadLogger (m :: Type -> Type)
monadLoggerLog :: (MonadLogger m, ToLogStr msg) => Loc -> LogSource -> LogLevel -> msg -> m ()
($dmmonadLoggerLog) :: forall (m' :: Type -> Type) (t :: (Type -> Type) -> Type -> Type) msg. (MonadLogger m, MonadLogger m', MonadTrans t, MonadLogger (t m'), ToLogStr msg, m ~ t m') => Loc -> LogSource -> LogLevel -> msg -> m ()

-- | An extension of MonadLogger for the common case where the
--   logging action is a simple IO action. The advantage of using
--   this typeclass is that the logging function itself can be extracted as
--   a first-class value, which can make it easier to manipulate monad
--   transformer stacks, as an example.
class (MonadLogger m, MonadIO m) => MonadLoggerIO (m :: Type -> Type)

-- | Request the logging function itself.
askLoggerIO :: MonadLoggerIO m => m (Loc -> LogSource -> LogLevel -> LogStr -> IO ())
($dmaskLoggerIO) :: forall (t :: (Type -> Type) -> Type -> Type) (n :: Type -> Type). (MonadLoggerIO m, MonadTrans t, MonadLoggerIO n, m ~ t n) => m (Loc -> LogSource -> LogLevel -> LogStr -> IO ())
data LogLevel
LevelDebug :: LogLevel
LevelInfo :: LogLevel
LevelWarn :: LogLevel
LevelError :: LogLevel
LevelOther :: Text -> LogLevel

type LogLine = (Loc, LogSource, LogLevel, LogStr)
type LogSource = Text

-- | Log message builder. Use (<>) to append two LogStr in
--   O(1).
data LogStr

-- | Types that can be converted to a LogStr. Instances for types
--   from the text library use a UTF-8 encoding. Instances for
--   numerical types use a decimal encoding.
class ToLogStr msg
toLogStr :: ToLogStr msg => msg -> LogStr

-- | Converting LogStr to ByteString.
fromLogStr :: LogStr -> ByteString

-- | Monad transformer that adds a new logging function.
newtype LoggingT (m :: Type -> Type) a
LoggingT :: ((Loc -> LogSource -> LogLevel -> LogStr -> IO ()) -> m a) -> LoggingT (m :: Type -> Type) a
[runLoggingT] :: LoggingT (m :: Type -> Type) a -> (Loc -> LogSource -> LogLevel -> LogStr -> IO ()) -> m a

-- | Run a block using a MonadLogger instance which prints to
--   stderr.
runStderrLoggingT :: MonadIO m => LoggingT m a -> m a

-- | Run a block using a MonadLogger instance which prints to
--   stdout.
runStdoutLoggingT :: MonadIO m => LoggingT m a -> m a

-- | Run a block using a MonadLogger instance which writes tuples
--   to an unbounded channel.
--   
--   The tuples can be extracted (ie. in another thread) with
--   unChanLoggingT or a custom extraction funtion, and written to a
--   destination.
runChanLoggingT :: MonadIO m => Chan LogLine -> LoggingT m a -> m a

-- | Run a block using a MonadLogger instance which appends to the
--   specified file.
runFileLoggingT :: MonadBaseControl IO m => FilePath -> LoggingT m a -> m a

-- | Read logging tuples from an unbounded channel and log them into a
--   MonadLoggerIO monad, forever.
--   
--   For use in a dedicated thread with a channel fed by
--   runChanLoggingT.
unChanLoggingT :: (MonadLogger m, MonadIO m) => Chan LogLine -> m void

-- | Within the LoggingT monad, capture all log messages to a
--   bounded channel of the indicated size, and only actually log them if
--   there is an exception.
withChannelLogger :: forall (m :: Type -> Type) a. (MonadBaseControl IO m, MonadIO m) => Int -> LoggingT m a -> LoggingT m a

-- | Only log messages passing the given predicate function.
--   
--   This can be a convenient way, for example, to ignore debug level
--   messages.
filterLogger :: forall (m :: Type -> Type) a. (LogSource -> LogLevel -> Bool) -> LoggingT m a -> LoggingT m a

-- | Monad transformer that disables logging.
newtype NoLoggingT (m :: Type -> Type) a
NoLoggingT :: m a -> NoLoggingT (m :: Type -> Type) a
[runNoLoggingT] :: NoLoggingT (m :: Type -> Type) a -> m a

-- | Map the unwrapped computation using the given function.
mapNoLoggingT :: (m a -> n b) -> NoLoggingT m a -> NoLoggingT n b

newtype WriterLoggingT (m :: Type -> Type) a
WriterLoggingT :: m (a, DList LogLine) -> WriterLoggingT (m :: Type -> Type) a
[unWriterLoggingT] :: WriterLoggingT (m :: Type -> Type) a -> m (a, DList LogLine)

-- | Run a block using a MonadLogger instance. Return logs in a
--   list | @since 0.3.28
execWriterLoggingT :: Functor m => WriterLoggingT m a -> m [LogLine]

-- | Run a block using a MonadLogger instance. Return a value and
--   logs in a list | @since 0.3.28
runWriterLoggingT :: Functor m => WriterLoggingT m a -> m (a, [LogLine])

-- | Map the unwrapped computation using the given function.
mapLoggingT :: (m a -> n b) -> LoggingT m a -> LoggingT n b

-- | Generates a function that takes a Text and logs a
--   LevelDebug message. Usage:
--   
--   
--   $(logDebug) "This is a debug log message"
--   
logDebug :: Q Exp

-- | See logDebug
logInfo :: Q Exp

-- | See logDebug
logWarn :: Q Exp

-- | See logDebug
logError :: Q Exp

-- | Generates a function that takes a Text and logs a
--   LevelOther message. Usage:
--   
--   
--   $(logOther "My new level") "This is a log message"
--   
logOther :: Text -> Q Exp

-- | Generates a function that takes a 'Show a => a' and logs a
--   LevelDebug message. Usage:
--   
--   
--   $(logDebugSH) (Just "This is a debug log message")
--   
logDebugSH :: Q Exp

-- | See logDebugSH
logInfoSH :: Q Exp

-- | See logDebugSH
logWarnSH :: Q Exp

-- | See logDebugSH
logErrorSH :: Q Exp

-- | Generates a function that takes a 'Show a => a' and logs a
--   LevelOther message. Usage:
--   
--   
--   $(logOtherSH "My new level") "This is a log message"
--   
logOtherSH :: Text -> Q Exp

-- | Generates a function that takes a LogSource and Text and
--   logs a LevelDebug message. Usage:
--   
--   
--   $logDebugS "SomeSource" "This is a debug log message"
--   
logDebugS :: Q Exp

-- | See logDebugS
logInfoS :: Q Exp

-- | See logDebugS
logWarnS :: Q Exp

-- | See logDebugS
logErrorS :: Q Exp

-- | Generates a function that takes a LogSource, a level name and a
--   Text and logs a LevelOther message. Usage:
--   
--   
--   $logOtherS "SomeSource" "My new level" "This is a log message"
--   
logOtherS :: Q Exp

-- | Lift a location into an Exp.
liftLoc :: Loc -> Q Exp
logDebugN :: MonadLogger m => Text -> m ()
logInfoN :: MonadLogger m => Text -> m ()
logWarnN :: MonadLogger m => Text -> m ()
logErrorN :: MonadLogger m => Text -> m ()
logOtherN :: MonadLogger m => LogLevel -> Text -> m ()

logWithoutLoc :: (MonadLogger m, ToLogStr msg) => LogSource -> LogLevel -> msg -> m ()
logDebugNS :: MonadLogger m => LogSource -> Text -> m ()
logInfoNS :: MonadLogger m => LogSource -> Text -> m ()
logWarnNS :: MonadLogger m => LogSource -> Text -> m ()
logErrorNS :: MonadLogger m => LogSource -> Text -> m ()
logOtherNS :: MonadLogger m => LogSource -> LogLevel -> Text -> m ()

-- | Logs a message with location given by CallStack. See
--   CallStack for more convenient functions for CallStack
--   based logging.
logDebugCS :: MonadLogger m => CallStack -> Text -> m ()

-- | See logDebugCS
logInfoCS :: MonadLogger m => CallStack -> Text -> m ()

-- | See logDebugCS
logWarnCS :: MonadLogger m => CallStack -> Text -> m ()

-- | See logDebugCS
logErrorCS :: MonadLogger m => CallStack -> Text -> m ()

-- | See logDebugCS
logOtherCS :: MonadLogger m => CallStack -> LogLevel -> Text -> m ()
defaultLogStr :: Loc -> LogSource -> LogLevel -> LogStr -> LogStr
data Loc
Loc :: String -> String -> String -> CharPos -> CharPos -> Loc
[loc_filename] :: Loc -> String
[loc_package] :: Loc -> String
[loc_module] :: Loc -> String
[loc_start] :: Loc -> CharPos
[loc_end] :: Loc -> CharPos

-- | dummy location, used with logWithoutLoc
defaultLoc :: Loc

-- | A default implementation of monadLoggerLog that accepts a file
--   handle as the first argument.
--   
--   This is used in the definition of runStdoutLoggingT:
--   
--   
--   runStdoutLoggingT :: MonadIO m => LoggingT m a -> m a
--   runStdoutLoggingT action =
--       runLoggingT action (defaultOutput stdout)
--   
defaultOutput :: Handle -> Loc -> LogSource -> LogLevel -> LogStr -> IO ()
instance GHC.Internal.Base.Alternative m => GHC.Internal.Base.Alternative (Control.Monad.Logger.LoggingT m)
instance GHC.Internal.Base.Alternative m => GHC.Internal.Base.Alternative (Control.Monad.Logger.NoLoggingT m)
instance GHC.Internal.Base.Applicative m => GHC.Internal.Base.Applicative (Control.Monad.Logger.LoggingT m)
instance GHC.Internal.Base.Applicative m => GHC.Internal.Base.Applicative (Control.Monad.Logger.NoLoggingT m)
instance GHC.Internal.Base.Applicative m => GHC.Internal.Base.Applicative (Control.Monad.Logger.WriterLoggingT m)
instance GHC.Classes.Eq Control.Monad.Logger.LogLevel
instance GHC.Internal.Base.Functor m => GHC.Internal.Base.Functor (Control.Monad.Logger.LoggingT m)
instance GHC.Internal.Base.Functor m => GHC.Internal.Base.Functor (Control.Monad.Logger.NoLoggingT m)
instance GHC.Internal.Base.Functor m => GHC.Internal.Base.Functor (Control.Monad.Logger.WriterLoggingT m)
instance Language.Haskell.TH.Syntax.Lift Control.Monad.Logger.LogLevel
instance Control.Monad.Accum.MonadAccum w m => Control.Monad.Accum.MonadAccum w (Control.Monad.Logger.LoggingT m)
instance Control.Monad.Accum.MonadAccum w m => Control.Monad.Accum.MonadAccum w (Control.Monad.Logger.NoLoggingT m)
instance Data.Conduit.Lazy.MonadActive m => Data.Conduit.Lazy.MonadActive (Control.Monad.Logger.LoggingT m)
instance Data.Conduit.Lazy.MonadActive m => Data.Conduit.Lazy.MonadActive (Control.Monad.Logger.NoLoggingT m)
instance Control.Monad.Trans.Control.MonadBaseControl b m => Control.Monad.Trans.Control.MonadBaseControl b (Control.Monad.Logger.LoggingT m)
instance Control.Monad.Trans.Control.MonadBaseControl b m => Control.Monad.Trans.Control.MonadBaseControl b (Control.Monad.Logger.NoLoggingT m)
instance Control.Monad.Trans.Control.MonadBaseControl b m => Control.Monad.Trans.Control.MonadBaseControl b (Control.Monad.Logger.WriterLoggingT m)
instance Control.Monad.Base.MonadBase b m => Control.Monad.Base.MonadBase b (Control.Monad.Logger.LoggingT m)
instance Control.Monad.Base.MonadBase b m => Control.Monad.Base.MonadBase b (Control.Monad.Logger.NoLoggingT m)
instance Control.Monad.Base.MonadBase b m => Control.Monad.Base.MonadBase b (Control.Monad.Logger.WriterLoggingT m)
instance Control.Monad.Catch.MonadCatch m => Control.Monad.Catch.MonadCatch (Control.Monad.Logger.LoggingT m)
instance Control.Monad.Catch.MonadCatch m => Control.Monad.Catch.MonadCatch (Control.Monad.Logger.NoLoggingT m)
instance Control.Monad.Catch.MonadCatch m => Control.Monad.Catch.MonadCatch (Control.Monad.Logger.WriterLoggingT m)
instance Control.Monad.Cont.Class.MonadCont m => Control.Monad.Cont.Class.MonadCont (Control.Monad.Logger.LoggingT m)
instance Control.Monad.Error.Class.MonadError e m => Control.Monad.Error.Class.MonadError e (Control.Monad.Logger.LoggingT m)
instance Control.Monad.Error.Class.MonadError e m => Control.Monad.Error.Class.MonadError e (Control.Monad.Logger.NoLoggingT m)
instance GHC.Internal.Control.Monad.Fail.MonadFail m => GHC.Internal.Control.Monad.Fail.MonadFail (Control.Monad.Logger.LoggingT m)
instance GHC.Internal.Control.Monad.Fail.MonadFail m => GHC.Internal.Control.Monad.Fail.MonadFail (Control.Monad.Logger.NoLoggingT m)
instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Control.Monad.Logger.LoggingT m)
instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Control.Monad.Logger.NoLoggingT m)
instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Control.Monad.Logger.WriterLoggingT m)
instance Control.Monad.Logger.MonadLoggerIO m => Control.Monad.Logger.MonadLoggerIO (Data.Conduit.Internal.Conduit.ConduitM i o m)
instance Control.Monad.Logger.MonadLoggerIO m => Control.Monad.Logger.MonadLoggerIO (Control.Monad.Trans.Cont.ContT r m)
instance Control.Monad.Logger.MonadLoggerIO m => Control.Monad.Logger.MonadLoggerIO (Control.Monad.Trans.Except.ExceptT e m)
instance Control.Monad.Logger.MonadLoggerIO m => Control.Monad.Logger.MonadLoggerIO (Control.Monad.Trans.Identity.IdentityT m)
instance Control.Monad.IO.Class.MonadIO m => Control.Monad.Logger.MonadLoggerIO (Control.Monad.Logger.LoggingT m)
instance Control.Monad.Logger.MonadLoggerIO m => Control.Monad.Logger.MonadLoggerIO (Control.Monad.Trans.Maybe.MaybeT m)
instance Control.Monad.IO.Class.MonadIO m => Control.Monad.Logger.MonadLoggerIO (Control.Monad.Logger.NoLoggingT m)
instance Control.Monad.Logger.MonadLoggerIO m => Control.Monad.Logger.MonadLoggerIO (Data.Conduit.Internal.Pipe.Pipe l i o u m)
instance (Control.Monad.Logger.MonadLoggerIO m, GHC.Internal.Base.Monoid w) => Control.Monad.Logger.MonadLoggerIO (Control.Monad.Trans.RWS.Strict.RWST r w s m)
instance (Control.Monad.Logger.MonadLoggerIO m, GHC.Internal.Base.Monoid w) => Control.Monad.Logger.MonadLoggerIO (Control.Monad.Trans.RWS.Lazy.RWST r w s m)
instance Control.Monad.Logger.MonadLoggerIO m => Control.Monad.Logger.MonadLoggerIO (Control.Monad.Trans.Reader.ReaderT r m)
instance Control.Monad.Logger.MonadLoggerIO m => Control.Monad.Logger.MonadLoggerIO (Control.Monad.Trans.Resource.Internal.ResourceT m)
instance Control.Monad.Logger.MonadLoggerIO m => Control.Monad.Logger.MonadLoggerIO (Control.Monad.Trans.State.Strict.StateT s m)
instance Control.Monad.Logger.MonadLoggerIO m => Control.Monad.Logger.MonadLoggerIO (Control.Monad.Trans.State.Lazy.StateT s m)
instance (Control.Monad.Logger.MonadLoggerIO m, GHC.Internal.Base.Monoid w) => Control.Monad.Logger.MonadLoggerIO (Control.Monad.Trans.Writer.Strict.WriterT w m)
instance (Control.Monad.Logger.MonadLoggerIO m, GHC.Internal.Base.Monoid w) => Control.Monad.Logger.MonadLoggerIO (Control.Monad.Trans.Writer.Lazy.WriterT w m)
instance Control.Monad.Logger.MonadLogger m => Control.Monad.Logger.MonadLogger (Data.Conduit.Internal.Conduit.ConduitM i o m)
instance Control.Monad.Logger.MonadLogger m => Control.Monad.Logger.MonadLogger (Control.Monad.Trans.Cont.ContT r m)
instance Control.Monad.Logger.MonadLogger m => Control.Monad.Logger.MonadLogger (Control.Monad.Trans.Except.ExceptT e m)
instance Control.Monad.Logger.MonadLogger m => Control.Monad.Logger.MonadLogger (Control.Monad.Trans.Identity.IdentityT m)
instance Control.Monad.IO.Class.MonadIO m => Control.Monad.Logger.MonadLogger (Control.Monad.Logger.LoggingT m)
instance Control.Monad.Logger.MonadLogger m => Control.Monad.Logger.MonadLogger (Control.Monad.Trans.Maybe.MaybeT m)
instance GHC.Internal.Base.Monad m => Control.Monad.Logger.MonadLogger (Control.Monad.Logger.NoLoggingT m)
instance Control.Monad.Logger.MonadLogger m => Control.Monad.Logger.MonadLogger (Data.Conduit.Internal.Pipe.Pipe l i o u m)
instance (Control.Monad.Logger.MonadLogger m, GHC.Internal.Base.Monoid w) => Control.Monad.Logger.MonadLogger (Control.Monad.Trans.RWS.Strict.RWST r w s m)
instance (Control.Monad.Logger.MonadLogger m, GHC.Internal.Base.Monoid w) => Control.Monad.Logger.MonadLogger (Control.Monad.Trans.RWS.Lazy.RWST r w s m)
instance Control.Monad.Logger.MonadLogger m => Control.Monad.Logger.MonadLogger (Control.Monad.Trans.Reader.ReaderT r m)
instance Control.Monad.Logger.MonadLogger m => Control.Monad.Logger.MonadLogger (Control.Monad.Trans.Resource.Internal.ResourceT m)
instance Control.Monad.Logger.MonadLogger m => Control.Monad.Logger.MonadLogger (Control.Monad.Trans.State.Strict.StateT s m)
instance Control.Monad.Logger.MonadLogger m => Control.Monad.Logger.MonadLogger (Control.Monad.Trans.State.Lazy.StateT s m)
instance GHC.Internal.Base.Monad m => Control.Monad.Logger.MonadLogger (Control.Monad.Logger.WriterLoggingT m)
instance (Control.Monad.Logger.MonadLogger m, GHC.Internal.Base.Monoid w) => Control.Monad.Logger.MonadLogger (Control.Monad.Trans.Writer.Strict.WriterT w m)
instance (Control.Monad.Logger.MonadLogger m, GHC.Internal.Base.Monoid w) => Control.Monad.Logger.MonadLogger (Control.Monad.Trans.Writer.Lazy.WriterT w m)
instance Control.Monad.Catch.MonadMask m => Control.Monad.Catch.MonadMask (Control.Monad.Logger.LoggingT m)
instance Control.Monad.Catch.MonadMask m => Control.Monad.Catch.MonadMask (Control.Monad.Logger.NoLoggingT m)
instance Control.Monad.Catch.MonadMask m => Control.Monad.Catch.MonadMask (Control.Monad.Logger.WriterLoggingT m)
instance Control.Monad.RWS.Class.MonadRWS r w s m => Control.Monad.RWS.Class.MonadRWS r w s (Control.Monad.Logger.LoggingT m)
instance Control.Monad.Reader.Class.MonadReader r m => Control.Monad.Reader.Class.MonadReader r (Control.Monad.Logger.LoggingT m)
instance Control.Monad.Reader.Class.MonadReader r m => Control.Monad.Reader.Class.MonadReader r (Control.Monad.Logger.NoLoggingT m)
instance Control.Monad.Trans.Resource.Internal.MonadResource m => Control.Monad.Trans.Resource.Internal.MonadResource (Control.Monad.Logger.LoggingT m)
instance Control.Monad.Trans.Resource.Internal.MonadResource m => Control.Monad.Trans.Resource.Internal.MonadResource (Control.Monad.Logger.NoLoggingT m)
instance Control.Monad.State.Class.MonadState s m => Control.Monad.State.Class.MonadState s (Control.Monad.Logger.LoggingT m)
instance Control.Monad.State.Class.MonadState s m => Control.Monad.State.Class.MonadState s (Control.Monad.Logger.NoLoggingT m)
instance Control.Monad.Catch.MonadThrow m => Control.Monad.Catch.MonadThrow (Control.Monad.Logger.LoggingT m)
instance Control.Monad.Catch.MonadThrow m => Control.Monad.Catch.MonadThrow (Control.Monad.Logger.NoLoggingT m)
instance Control.Monad.Catch.MonadThrow m => Control.Monad.Catch.MonadThrow (Control.Monad.Logger.WriterLoggingT m)
instance Control.Monad.Trans.Control.MonadTransControl Control.Monad.Logger.LoggingT
instance Control.Monad.Trans.Control.MonadTransControl Control.Monad.Logger.NoLoggingT
instance Control.Monad.Trans.Control.MonadTransControl Control.Monad.Logger.WriterLoggingT
instance Control.Monad.Trans.Class.MonadTrans Control.Monad.Logger.LoggingT
instance Control.Monad.Trans.Class.MonadTrans Control.Monad.Logger.NoLoggingT
instance Control.Monad.Trans.Class.MonadTrans Control.Monad.Logger.WriterLoggingT
instance Control.Monad.IO.Unlift.MonadUnliftIO m => Control.Monad.IO.Unlift.MonadUnliftIO (Control.Monad.Logger.LoggingT m)
instance Control.Monad.IO.Unlift.MonadUnliftIO m => Control.Monad.IO.Unlift.MonadUnliftIO (Control.Monad.Logger.NoLoggingT m)
instance GHC.Internal.Base.Monad m => GHC.Internal.Base.Monad (Control.Monad.Logger.LoggingT m)
instance GHC.Internal.Base.Monad m => GHC.Internal.Base.Monad (Control.Monad.Logger.NoLoggingT m)
instance GHC.Internal.Base.Monad m => GHC.Internal.Base.Monad (Control.Monad.Logger.WriterLoggingT m)
instance Control.Monad.Writer.Class.MonadWriter w m => Control.Monad.Writer.Class.MonadWriter w (Control.Monad.Logger.LoggingT m)
instance Control.Monad.Writer.Class.MonadWriter w m => Control.Monad.Writer.Class.MonadWriter w (Control.Monad.Logger.NoLoggingT m)
instance (GHC.Internal.Base.Applicative m, GHC.Internal.Base.Monoid a) => GHC.Internal.Base.Monoid (Control.Monad.Logger.LoggingT m a)
instance (GHC.Internal.Base.Applicative m, GHC.Internal.Base.Monoid a) => GHC.Internal.Base.Monoid (Control.Monad.Logger.NoLoggingT m a)
instance (GHC.Internal.Base.Applicative m, GHC.Internal.Base.Monoid a) => GHC.Internal.Base.Monoid (Control.Monad.Logger.WriterLoggingT m a)
instance GHC.Classes.Ord Control.Monad.Logger.LogLevel
instance GHC.Internal.Read.Read Control.Monad.Logger.LogLevel
instance (GHC.Internal.Base.Applicative m, GHC.Internal.Base.Semigroup a) => GHC.Internal.Base.Semigroup (Control.Monad.Logger.LoggingT m a)
instance (GHC.Internal.Base.Applicative m, GHC.Internal.Base.Semigroup a) => GHC.Internal.Base.Semigroup (Control.Monad.Logger.NoLoggingT m a)
instance (GHC.Internal.Base.Applicative m, GHC.Internal.Base.Semigroup a) => GHC.Internal.Base.Semigroup (Control.Monad.Logger.WriterLoggingT m a)
instance GHC.Internal.Show.Show Control.Monad.Logger.LogLevel

-- | Log functions using CallStack support in place of Template Haskell
module Control.Monad.Logger.CallStack

-- | Types that can be converted to a LogStr. Instances for types
--   from the text library use a UTF-8 encoding. Instances for
--   numerical types use a decimal encoding.
class ToLogStr msg
toLogStr :: ToLogStr msg => msg -> LogStr

-- | Log message builder. Use (<>) to append two LogStr in
--   O(1).
data LogStr

-- | Converting LogStr to ByteString.
fromLogStr :: LogStr -> ByteString
data Loc
Loc :: String -> String -> String -> CharPos -> CharPos -> Loc
[loc_filename] :: Loc -> String
[loc_package] :: Loc -> String
[loc_module] :: Loc -> String
[loc_start] :: Loc -> CharPos
[loc_end] :: Loc -> CharPos

-- | A Monad which has the ability to log messages in some manner.
class Monad m => MonadLogger (m :: Type -> Type)
monadLoggerLog :: (MonadLogger m, ToLogStr msg) => Loc -> LogSource -> LogLevel -> msg -> m ()
($dmmonadLoggerLog) :: forall (m' :: Type -> Type) (t :: (Type -> Type) -> Type -> Type) msg. (MonadLogger m, MonadLogger m', MonadTrans t, MonadLogger (t m'), ToLogStr msg, m ~ t m') => Loc -> LogSource -> LogLevel -> msg -> m ()

-- | An extension of MonadLogger for the common case where the
--   logging action is a simple IO action. The advantage of using
--   this typeclass is that the logging function itself can be extracted as
--   a first-class value, which can make it easier to manipulate monad
--   transformer stacks, as an example.
class (MonadLogger m, MonadIO m) => MonadLoggerIO (m :: Type -> Type)

-- | Request the logging function itself.
askLoggerIO :: MonadLoggerIO m => m (Loc -> LogSource -> LogLevel -> LogStr -> IO ())
($dmaskLoggerIO) :: forall (t :: (Type -> Type) -> Type -> Type) (n :: Type -> Type). (MonadLoggerIO m, MonadTrans t, MonadLoggerIO n, m ~ t n) => m (Loc -> LogSource -> LogLevel -> LogStr -> IO ())
data LogLevel
LevelDebug :: LogLevel
LevelInfo :: LogLevel
LevelWarn :: LogLevel
LevelError :: LogLevel
LevelOther :: Text -> LogLevel

type LogLine = (Loc, LogSource, LogLevel, LogStr)
type LogSource = Text

-- | Monad transformer that adds a new logging function.
newtype LoggingT (m :: Type -> Type) a
LoggingT :: ((Loc -> LogSource -> LogLevel -> LogStr -> IO ()) -> m a) -> LoggingT (m :: Type -> Type) a
[runLoggingT] :: LoggingT (m :: Type -> Type) a -> (Loc -> LogSource -> LogLevel -> LogStr -> IO ()) -> m a

-- | Run a block using a MonadLogger instance which prints to
--   stderr.
runStderrLoggingT :: MonadIO m => LoggingT m a -> m a

-- | Run a block using a MonadLogger instance which prints to
--   stdout.
runStdoutLoggingT :: MonadIO m => LoggingT m a -> m a

-- | Run a block using a MonadLogger instance which writes tuples
--   to an unbounded channel.
--   
--   The tuples can be extracted (ie. in another thread) with
--   unChanLoggingT or a custom extraction funtion, and written to a
--   destination.
runChanLoggingT :: MonadIO m => Chan LogLine -> LoggingT m a -> m a

-- | Run a block using a MonadLogger instance which appends to the
--   specified file.
runFileLoggingT :: MonadBaseControl IO m => FilePath -> LoggingT m a -> m a

-- | Read logging tuples from an unbounded channel and log them into a
--   MonadLoggerIO monad, forever.
--   
--   For use in a dedicated thread with a channel fed by
--   runChanLoggingT.
unChanLoggingT :: (MonadLogger m, MonadIO m) => Chan LogLine -> m void

-- | Within the LoggingT monad, capture all log messages to a
--   bounded channel of the indicated size, and only actually log them if
--   there is an exception.
withChannelLogger :: forall (m :: Type -> Type) a. (MonadBaseControl IO m, MonadIO m) => Int -> LoggingT m a -> LoggingT m a

-- | Only log messages passing the given predicate function.
--   
--   This can be a convenient way, for example, to ignore debug level
--   messages.
filterLogger :: forall (m :: Type -> Type) a. (LogSource -> LogLevel -> Bool) -> LoggingT m a -> LoggingT m a

-- | Monad transformer that disables logging.
newtype NoLoggingT (m :: Type -> Type) a
NoLoggingT :: m a -> NoLoggingT (m :: Type -> Type) a
[runNoLoggingT] :: NoLoggingT (m :: Type -> Type) a -> m a

-- | Map the unwrapped computation using the given function.
mapNoLoggingT :: (m a -> n b) -> NoLoggingT m a -> NoLoggingT n b

newtype WriterLoggingT (m :: Type -> Type) a
WriterLoggingT :: m (a, DList LogLine) -> WriterLoggingT (m :: Type -> Type) a
[unWriterLoggingT] :: WriterLoggingT (m :: Type -> Type) a -> m (a, DList LogLine)

-- | Run a block using a MonadLogger instance. Return logs in a
--   list | @since 0.3.28
execWriterLoggingT :: Functor m => WriterLoggingT m a -> m [LogLine]

-- | Run a block using a MonadLogger instance. Return a value and
--   logs in a list | @since 0.3.28
runWriterLoggingT :: Functor m => WriterLoggingT m a -> m (a, [LogLine])

-- | Map the unwrapped computation using the given function.
mapLoggingT :: (m a -> n b) -> LoggingT m a -> LoggingT n b

-- | Generates a function that takes a LogSource and Text and
--   logs a LevelDebug message. Usage:
--   
--   
--   $logDebugS "SomeSource" "This is a debug log message"
--   
logDebugS :: Q Exp

-- | See logDebugS
logInfoS :: Q Exp

-- | See logDebugS
logWarnS :: Q Exp

-- | See logDebugS
logErrorS :: Q Exp

-- | Generates a function that takes a LogSource, a level name and a
--   Text and logs a LevelOther message. Usage:
--   
--   
--   $logOtherS "SomeSource" "My new level" "This is a log message"
--   
logOtherS :: Q Exp

-- | Lift a location into an Exp.
liftLoc :: Loc -> Q Exp
logDebugN :: MonadLogger m => Text -> m ()
logInfoN :: MonadLogger m => Text -> m ()
logWarnN :: MonadLogger m => Text -> m ()
logErrorN :: MonadLogger m => Text -> m ()
logOtherN :: MonadLogger m => LogLevel -> Text -> m ()

logWithoutLoc :: (MonadLogger m, ToLogStr msg) => LogSource -> LogLevel -> msg -> m ()
logDebugNS :: MonadLogger m => LogSource -> Text -> m ()
logInfoNS :: MonadLogger m => LogSource -> Text -> m ()
logWarnNS :: MonadLogger m => LogSource -> Text -> m ()
logErrorNS :: MonadLogger m => LogSource -> Text -> m ()
logOtherNS :: MonadLogger m => LogSource -> LogLevel -> Text -> m ()

-- | Logs a message with location given by CallStack. See
--   CallStack for more convenient functions for CallStack
--   based logging.
logDebugCS :: MonadLogger m => CallStack -> Text -> m ()

-- | See logDebugCS
logInfoCS :: MonadLogger m => CallStack -> Text -> m ()

-- | See logDebugCS
logWarnCS :: MonadLogger m => CallStack -> Text -> m ()

-- | See logDebugCS
logErrorCS :: MonadLogger m => CallStack -> Text -> m ()

-- | See logDebugCS
logOtherCS :: MonadLogger m => CallStack -> LogLevel -> Text -> m ()
defaultLogStr :: Loc -> LogSource -> LogLevel -> LogStr -> LogStr

-- | dummy location, used with logWithoutLoc
defaultLoc :: Loc

-- | A default implementation of monadLoggerLog that accepts a file
--   handle as the first argument.
--   
--   This is used in the definition of runStdoutLoggingT:
--   
--   
--   runStdoutLoggingT :: MonadIO m => LoggingT m a -> m a
--   runStdoutLoggingT action =
--       runLoggingT action (defaultOutput stdout)
--   
defaultOutput :: Handle -> Loc -> LogSource -> LogLevel -> LogStr -> IO ()

-- | Logs a message with the location provided by an implicit
--   CallStack.
logDebug :: (HasCallStack, MonadLogger m) => Text -> m ()

-- | See logDebug
logInfo :: (HasCallStack, MonadLogger m) => Text -> m ()

-- | See logDebug
logWarn :: (HasCallStack, MonadLogger m) => Text -> m ()

-- | See logDebug
logError :: (HasCallStack, MonadLogger m) => Text -> m ()

-- | See logDebug
logOther :: (HasCallStack, MonadLogger m) => LogLevel -> Text -> m ()

-- | Logs a showable value with the location provided by an implicit
--   CallStack.
logDebugSH :: (HasCallStack, MonadLogger m, Show a) => a -> m ()

-- | See logDebugSH
logInfoSH :: (HasCallStack, MonadLogger m, Show a) => a -> m ()

-- | See logDebugSH
logWarnSH :: (HasCallStack, MonadLogger m, Show a) => a -> m ()

-- | See logDebugSH
logErrorSH :: (HasCallStack, MonadLogger m, Show a) => a -> m ()

-- | See logDebugSH
logOtherSH :: (HasCallStack, MonadLogger m, Show a) => LogLevel -> a -> m ()
