log-warper-1.5.3: Flexible, configurable, monadic and pretty logging

Safe HaskellNone
LanguageHaskell2010

System.Wlog.CanLog

Contents

Description

Type class that add ability to log messages. Supports pure and IO logging.

Synopsis

Documentation

class Monad m => CanLog m where Source #

Instances of this class should explain how they add messages to their log.

Methods

dispatchMessage :: LoggerName -> Severity -> Text -> m () Source #

dispatchMessage :: (MonadTrans t, t n ~ m, CanLog n) => LoggerName -> Severity -> Text -> m () Source #

type WithLogger m = (CanLog m, HasLoggerName m) Source #

Type alias for constraints CanLog and HasLoggerName. We need two different type classes to support more flexible interface but in practice we usually use them both.

Logging functions

logDebug :: WithLogger m => Text -> m () Source #

Shortcut for logMessage to use according severity.

logError :: WithLogger m => Text -> m () Source #

Shortcut for logMessage to use according severity.

logInfo :: WithLogger m => Text -> m () Source #

Shortcut for logMessage to use according severity.

logNotice :: WithLogger m => Text -> m () Source #

Shortcut for logMessage to use according severity.

logWarning :: WithLogger m => Text -> m () Source #

Shortcut for logMessage to use according severity.

logMessage :: WithLogger m => Severity -> Text -> m () Source #

Logs message with specified severity using logger name in context.