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

-- | Simple logging abstraction that allows multiple back-ends
--   
--   Simple logging abstraction that allows multiple back-ends
@package logging-facade
@version 0.3.1

module System.Logging.Facade.Types
data LogLevel
TRACE :: LogLevel
DEBUG :: LogLevel
INFO :: LogLevel
WARN :: LogLevel
ERROR :: LogLevel
data Location
Location :: String -> String -> String -> Int -> Int -> Location
[locationPackage] :: Location -> String
[locationModule] :: Location -> String
[locationFile] :: Location -> String
[locationLine] :: Location -> Int
[locationColumn] :: Location -> Int
data LogRecord
LogRecord :: LogLevel -> Maybe Location -> String -> LogRecord
[logRecordLevel] :: LogRecord -> LogLevel
[logRecordLocation] :: LogRecord -> Maybe Location
[logRecordMessage] :: LogRecord -> String
instance GHC.Internal.Enum.Bounded System.Logging.Facade.Types.LogLevel
instance GHC.Internal.Enum.Enum System.Logging.Facade.Types.LogLevel
instance GHC.Classes.Eq System.Logging.Facade.Types.Location
instance GHC.Classes.Eq System.Logging.Facade.Types.LogLevel
instance GHC.Classes.Eq System.Logging.Facade.Types.LogRecord
instance GHC.Classes.Ord System.Logging.Facade.Types.LogLevel
instance GHC.Internal.Read.Read System.Logging.Facade.Types.LogLevel
instance GHC.Internal.Show.Show System.Logging.Facade.Types.Location
instance GHC.Internal.Show.Show System.Logging.Facade.Types.LogLevel
instance GHC.Internal.Show.Show System.Logging.Facade.Types.LogRecord

module System.Logging.Facade.Sink

-- | A consumer for log records
type LogSink = LogRecord -> IO ()

-- | A thread-safe log sink that writes log messages to stderr
defaultLogSink :: IO LogSink

-- | Return the global log sink.
getLogSink :: IO LogSink

-- | Set the global log sink.
setLogSink :: LogSink -> IO ()

-- | Return the global log sink and set it to a new value in one atomic
--   operation.
swapLogSink :: LogSink -> IO LogSink

-- | Set the global log sink to a specified value, run given action, and
--   finally restore the global log sink to its previous value.
withLogSink :: LogSink -> IO () -> IO ()

module System.Logging.Facade.Class

-- | A type class for monads with logging support
class Monad m => Logging (m :: Type -> Type)
consumeLogRecord :: Logging m => LogRecord -> m ()
instance System.Logging.Facade.Class.Logging m => System.Logging.Facade.Class.Logging (Control.Monad.Trans.Cont.ContT r m)
instance System.Logging.Facade.Class.Logging m => System.Logging.Facade.Class.Logging (Control.Monad.Trans.Except.ExceptT e m)
instance System.Logging.Facade.Class.Logging GHC.Types.IO
instance System.Logging.Facade.Class.Logging m => System.Logging.Facade.Class.Logging (Control.Monad.Trans.Identity.IdentityT m)
instance System.Logging.Facade.Class.Logging m => System.Logging.Facade.Class.Logging (Control.Monad.Trans.Maybe.MaybeT m)
instance (GHC.Internal.Base.Monoid w, System.Logging.Facade.Class.Logging m) => System.Logging.Facade.Class.Logging (Control.Monad.Trans.RWS.Strict.RWST r w s m)
instance (GHC.Internal.Base.Monoid w, System.Logging.Facade.Class.Logging m) => System.Logging.Facade.Class.Logging (Control.Monad.Trans.RWS.Lazy.RWST r w s m)
instance System.Logging.Facade.Class.Logging m => System.Logging.Facade.Class.Logging (Control.Monad.Trans.Reader.ReaderT r m)
instance System.Logging.Facade.Class.Logging m => System.Logging.Facade.Class.Logging (Control.Monad.Trans.State.Strict.StateT s m)
instance System.Logging.Facade.Class.Logging m => System.Logging.Facade.Class.Logging (Control.Monad.Trans.State.Lazy.StateT s m)
instance (GHC.Internal.Base.Monoid w, System.Logging.Facade.Class.Logging m) => System.Logging.Facade.Class.Logging (Control.Monad.Trans.Writer.Strict.WriterT w m)
instance (GHC.Internal.Base.Monoid w, System.Logging.Facade.Class.Logging m) => System.Logging.Facade.Class.Logging (Control.Monad.Trans.Writer.Lazy.WriterT w m)

-- | This module is intended to be imported qualified:
--   
--   
--   import qualified System.Logging.Facade as Log
--   
module System.Logging.Facade

-- | Produce a log message with specified log level.
log :: (HasCallStack, Logging m) => LogLevel -> String -> m ()

-- | Produce a log message with log level TRACE.
trace :: (HasCallStack, Logging m) => String -> m ()

-- | Produce a log message with log level DEBUG.
debug :: (HasCallStack, Logging m) => String -> m ()

-- | Produce a log message with log level INFO.
info :: (HasCallStack, Logging m) => String -> m ()

-- | Produce a log message with log level WARN.
warn :: (HasCallStack, Logging m) => String -> m ()

-- | Produce a log message with log level ERROR.
error :: (HasCallStack, Logging m) => String -> m ()

-- | A type class for monads with logging support
class Monad m => Logging (m :: Type -> Type)
data LogLevel
TRACE :: LogLevel
DEBUG :: LogLevel
INFO :: LogLevel
WARN :: LogLevel
ERROR :: LogLevel
