polysemy-log-0.11.1.0: Polysemy effects for logging
Safe HaskellNone
LanguageGHC2021

Polysemy.Log.Effect.DataLog

Description

 
Synopsis

Documentation

data DataLog a (b :: Type -> Type) c where Source #

Structural logs, used as a backend for the simpler Text log effect, Log.

Can also be used on its own, or reinterpreted into an effect like those from co-log or di.

Constructors

DataLog :: forall a (b :: Type -> Type). a -> DataLog a b ()

Schedule an arbitrary value for logging.

Local :: forall a (b :: Type -> Type) c. (a -> a) -> b c -> DataLog a b c

Stores the provided function in the interpreter and applies it to all log messages emitted within the higher-order thunk that's the second argument.

dataLog :: forall a (r :: EffectRow). Member (DataLog a) r => a -> Sem r () Source #

Schedule an arbitrary value for logging.

local :: forall a (r :: EffectRow) b. Member (DataLog a) r => (a -> a) -> Sem r b -> Sem r b Source #

Stores the provided function in the interpreter and applies it to all log messages emitted within the higher-order thunk that's the second argument.

type Logger = DataLog (LogEntry LogMessage) Source #

Alias for the logger with the default message type used by Log.

log :: forall (r :: EffectRow). (HasCallStack, Members '[Logger, GhcTime] r) => Severity -> Text -> Sem r () Source #

Log a text message with the given severity. Basic Sem constructor.

trace :: forall (r :: EffectRow). (HasCallStack, Members '[Logger, GhcTime] r) => Text -> Sem r () Source #

Log a text message with the Trace severity.

debug :: forall (r :: EffectRow). (HasCallStack, Members '[Logger, GhcTime] r) => Text -> Sem r () Source #

Log a text message with the Debug severity.

info :: forall (r :: EffectRow). (HasCallStack, Members '[Logger, GhcTime] r) => Text -> Sem r () Source #

Log a text message with the Info severity.

warn :: forall (r :: EffectRow). (HasCallStack, Members '[Logger, GhcTime] r) => Text -> Sem r () Source #

Log a text message with the Warn severity.

error :: forall (r :: EffectRow). (HasCallStack, Members '[Logger, GhcTime] r) => Text -> Sem r () Source #

Log a text message with the Error severity.

crit :: forall (r :: EffectRow). (HasCallStack, Members '[Logger, GhcTime] r) => Text -> Sem r () Source #

Log a text message with the Crit severity.