heavy-logger-0.3.2.1: Full-weight logging based on fast-logger

Safe HaskellNone
LanguageHaskell2010

System.Log.Heavy.Util

Contents

Synopsis

Functions of common use

logMessage :: forall m. (HasLogging m, MonadIO m) => LogMessage -> m () Source #

Log a message. This will add current context to context specified in the message. This function checks current context filter.

Utilities for backends implementation

checkLogLevel :: LogFilter -> LogMessage -> Bool Source #

Check if message level matches given filter.

checkLogLevel' :: LogFilter -> LogSource -> Level -> Bool Source #

Check if message level matches given filter.

checkContextFilter :: LogContext -> LogMessage -> Bool Source #

Check if message matches filters from logging context.

The message is passed if:

  • No include filters are defined in context stack, OR the message conforms to ANY of include filters;
  • AND the message does not conform to any of exclude filters in the stack.

checkContextFilter' :: [LogContextFilter] -> LogSource -> Level -> Bool Source #

Check if message source and level passes specified filters.

The message is passed if:

  • No include filters are defined in context stack, OR the message conforms to ANY of include filters;
  • AND the message does not conform to any of exclude filters in the stack.

checkContextFilterM :: HasLogContext m => LogMessage -> m Bool Source #

Check if message matches filters from logging context. This function is similar to checkContextFilter, but uses current context from monadic state.