logging-facade-0.3.1: Simple logging abstraction that allows multiple back-ends

Safe Haskell | None
Language | Haskell2010

System.Logging.Facade

Contents

- Producing log messages
- Types

Description

This module is intended to be imported qualified:

    import qualified System.Logging.Facade as Log

Synopsis

- log :: (HasCallStack, Logging m) => LogLevel -> String -> m ()
- trace :: (HasCallStack, Logging m) => String -> m ()
- debug :: (HasCallStack, Logging m) => String -> m ()
- info :: (HasCallStack, Logging m) => String -> m ()
- warn :: (HasCallStack, Logging m) => String -> m ()
- error :: (HasCallStack, Logging m) => String -> m ()
- class Monad m => Logging (m :: Type -> Type)
- data LogLevel
  - = TRACE
  - | DEBUG
  - | INFO
  - | WARN
  - | ERROR

# Producing log messages

log :: (HasCallStack, Logging m) => LogLevel -> String -> m () Source #

Produce a log message with specified log level.

trace :: (HasCallStack, Logging m) => String -> m () Source #

Produce a log message with log level `TRACE`.

debug :: (HasCallStack, Logging m) => String -> m () Source #

Produce a log message with log level `DEBUG`.

info :: (HasCallStack, Logging m) => String -> m () Source #

Produce a log message with log level `INFO`.

warn :: (HasCallStack, Logging m) => String -> m () Source #

Produce a log message with log level `WARN`.

error :: (HasCallStack, Logging m) => String -> m () Source #

Produce a log message with log level `ERROR`.

# Types

class Monad m => Logging (m :: Type -> Type) Source #

A type class for monads with logging support

Minimal complete definition

consumeLogRecord

#### Instances

Instances details

Logging IO Source # | Log messages that are produced in the `IO` monad are consumed by the global `LogSink`.
Instance details Defined in System.Logging.Facade.Class Methods consumeLogRecord :: LogRecord -> IO () Source #
Logging m => Logging (MaybeT m) Source # |
Instance details Defined in System.Logging.Facade.Class Methods consumeLogRecord :: LogRecord -> MaybeT m () Source #
Logging m => Logging (ExceptT e m) Source # |
Instance details Defined in System.Logging.Facade.Class Methods consumeLogRecord :: LogRecord -> ExceptT e m () Source #
Logging m => Logging (IdentityT m) Source # |
Instance details Defined in System.Logging.Facade.Class Methods consumeLogRecord :: LogRecord -> IdentityT m () Source #
Logging m => Logging (ReaderT r m) Source # |
Instance details Defined in System.Logging.Facade.Class Methods consumeLogRecord :: LogRecord -> ReaderT r m () Source #
Logging m => Logging (StateT s m) Source # |
Instance details Defined in System.Logging.Facade.Class Methods consumeLogRecord :: LogRecord -> StateT s m () Source #
Logging m => Logging (StateT s m) Source # |
Instance details Defined in System.Logging.Facade.Class Methods consumeLogRecord :: LogRecord -> StateT s m () Source #
(Monoid w, Logging m) => Logging (WriterT w m) Source # |
Instance details Defined in System.Logging.Facade.Class Methods consumeLogRecord :: LogRecord -> WriterT w m () Source #
(Monoid w, Logging m) => Logging (WriterT w m) Source # |
Instance details Defined in System.Logging.Facade.Class Methods consumeLogRecord :: LogRecord -> WriterT w m () Source #
Logging m => Logging (ContT r m) Source # |
Instance details Defined in System.Logging.Facade.Class Methods consumeLogRecord :: LogRecord -> ContT r m () Source #
(Monoid w, Logging m) => Logging (RWST r w s m) Source # |
Instance details Defined in System.Logging.Facade.Class Methods consumeLogRecord :: LogRecord -> RWST r w s m () Source #
(Monoid w, Logging m) => Logging (RWST r w s m) Source # |
Instance details Defined in System.Logging.Facade.Class Methods consumeLogRecord :: LogRecord -> RWST r w s m () Source #

data LogLevel Source #

Constructors

TRACE |
DEBUG |
INFO |
WARN |
ERROR |

#### Instances

Instances details

Bounded LogLevel Source # |
Instance details Defined in System.Logging.Facade.Types Methods minBound :: LogLevel Source # maxBound :: LogLevel Source #
Enum LogLevel Source # |

Instance details

Defined in System.Logging.Facade.Types

Methods

succ :: LogLevel -> LogLevel Source #

pred :: LogLevel -> LogLevel Source #

toEnum :: Int -> LogLevel Source #

fromEnum :: LogLevel -> Int Source #

enumFrom :: LogLevel -> [LogLevel] Source #

enumFromThen :: LogLevel -> LogLevel -> [LogLevel] Source #

enumFromTo :: LogLevel -> LogLevel -> [LogLevel] Source #

enumFromThenTo :: LogLevel -> LogLevel -> LogLevel -> [LogLevel] Source #

Read LogLevel Source # |
Instance details Defined in System.Logging.Facade.Types Methods readsPrec :: Int -> ReadS LogLevel Source # readList :: ReadS [LogLevel] Source # readPrec :: ReadPrec LogLevel Source # readListPrec :: ReadPrec [LogLevel] Source #
Show LogLevel Source # |
Instance details Defined in System.Logging.Facade.Types Methods showsPrec :: Int -> LogLevel -> ShowS Source # show :: LogLevel -> String Source # showList :: [LogLevel] -> ShowS Source #
Eq LogLevel Source # |
Instance details Defined in System.Logging.Facade.Types Methods (==) :: LogLevel -> LogLevel -> Bool Source # (/=) :: LogLevel -> LogLevel -> Bool Source #
Ord LogLevel Source # |
Instance details Defined in System.Logging.Facade.Types Methods compare :: LogLevel -> LogLevel -> Ordering Source # (<) :: LogLevel -> LogLevel -> Bool Source # (<=) :: LogLevel -> LogLevel -> Bool Source # (>) :: LogLevel -> LogLevel -> Bool Source # (>=) :: LogLevel -> LogLevel -> Bool Source # max :: LogLevel -> LogLevel -> LogLevel Source # min :: LogLevel -> LogLevel -> LogLevel Source #