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


-- | Simple logging abstraction that allows multiple backends
--   
--   Simple logging abstraction that allows multiple backends
@package logging-facade
@version 0.0.0

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 Eq LogLevel
instance Show LogLevel
instance Ord LogLevel
instance Bounded LogLevel
instance Enum LogLevel
instance Eq Location
instance Show Location
instance Eq LogRecord
instance Show LogRecord

module System.Logging.Facade.Sink

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

-- | A log sink that writes log messages to <a>stderr</a>
defaultLogSink :: LogSink

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

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

module System.Logging.Facade.Class

-- | A type class for monads with logging support
class Monad m => Logging m
consumeLogRecord :: Logging m => LogRecord -> m ()

-- | Log messages that are produced in the <a>IO</a> monad are consumed by
--   the global <a>LogSink</a>.
instance (Monoid w, Logging m) => Logging (WriterT w m)
instance (Monoid w, Logging m) => Logging (WriterT w m)
instance Logging m => Logging (StateT s m)
instance Logging m => Logging (StateT s m)
instance (Monoid w, Logging m) => Logging (RWST r w s m)
instance (Monoid w, Logging m) => Logging (RWST r w s m)
instance Logging m => Logging (ReaderT r m)
instance Logging m => Logging (MaybeT m)
instance Logging m => Logging (ListT m)
instance Logging m => Logging (IdentityT m)
instance (Error e, Logging m) => Logging (ErrorT e m)
instance Logging m => Logging (ContT r m)
instance Logging IO


-- | This module is intended to be imported qualified:
--   
--   <pre>
--   import qualified System.Logging.Facade.TH as Log
--   </pre>
module System.Logging.Facade.TH

-- | A Template Haskell version of <a>log</a> that adds a source location
--   to the produced log record.
log :: ExpQ

-- | A Template Haskell version of <a>trace</a> that adds a source location
--   to the produced log record.
trace :: ExpQ

-- | A Template Haskell version of <a>debug</a> that adds a source location
--   to the produced log record.
debug :: ExpQ

-- | A Template Haskell version of <a>info</a> that adds a source location
--   to the produced log record.
info :: ExpQ

-- | A Template Haskell version of <a>warn</a> that adds a source location
--   to the produced log record.
warn :: ExpQ

-- | A Template Haskell version of <a>error</a> that adds a source location
--   to the produced log record.
error :: ExpQ

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


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

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

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

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

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

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

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

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