Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- interpretLogStdout :: Member (Embed IO) r => InterpreterFor Log r
- interpretLogStdoutConc :: Members [Resource, Async, Embed IO] r => InterpreterFor Log r
- interpretLogStdoutAsNative :: Member (Embed IO) r => InterpretersFor [Log, Log Message] r
- interpretLogColog :: Members [Log (LogEntry LogMessage), GhcTime] r => InterpreterFor Log r
- interpretLogColog' :: Members [Log (LogEntry LogMessage), Embed IO] r => InterpretersFor [Log, GhcTime] r
- interpretDataLogColog :: forall a r. Member (Log a) r => InterpreterFor (DataLog a) r
- interpretCologConcNative :: Members [Resource, Embed IO] r => InterpreterFor (Log (LogEntry LogMessage)) r
- interpretCologConcNativeWith :: forall msg r. Members [Resource, Embed IO] r => Capacity -> LogAction IO msg -> InterpreterFor (Log msg) r
- interpretCologAtomic :: forall a r. Member (Embed IO) r => InterpretersFor [Log a, AtomicState [a]] r
- interpretCologAtomic' :: forall a r. Member (AtomicState [a]) r => InterpreterFor (Log a) r
Introduction
This package is a co-log adapter for
polysemy-log, providing interpreters that convert
Log
and DataLog
into Log
actions.
import Polysemy.Log import Polysemy.Log.Colog prog :: Member Log r => Sem r () prog = do Log.debug "debugging" Log.error "failing" interpretLogColog prog :: Sem [Colog.Log (LogEntry LogMessage), Embed IO] () interpretLogStdout prog :: Sem '[Embed IO] ()
Interpreters
interpretLogStdout :: Member (Embed IO) r => InterpreterFor Log r Source #
Interpret Log
fully in terms of Log
, using the default message and stdout.
interpretLogStdoutConc :: Members [Resource, Async, Embed IO] r => InterpreterFor Log r Source #
Like interpretLogStdout
, but process messages concurrently.
interpretLogStdoutAsNative :: Member (Embed IO) r => InterpretersFor [Log, Log Message] r Source #
Interpret Log
fully in terms of Log
, using co-log's message protocol and stdout.
interpretLogColog :: Members [Log (LogEntry LogMessage), GhcTime] r => InterpreterFor Log r Source #
Reinterpret Log
as Log
, using the polysemy-log default message.
Since this adds a timestamp, it has a dependency on GhcTime
.
Use interpretLogColog'
for a variant that interprets GhcTime
in-place.
interpretLogColog' :: Members [Log (LogEntry LogMessage), Embed IO] r => InterpretersFor [Log, GhcTime] r Source #
interpretDataLogColog :: forall a r. Member (Log a) r => InterpreterFor (DataLog a) r Source #
Reinterpret DataLog
as Log
.
interpretCologConcNative :: Members [Resource, Embed IO] r => InterpreterFor (Log (LogEntry LogMessage)) r Source #
Interpret Log
using co-log's concurrent logger with the default message and formatting.
interpretCologConcNativeWith :: forall msg r. Members [Resource, Embed IO] r => Capacity -> LogAction IO msg -> InterpreterFor (Log msg) r Source #
interpretCologAtomic :: forall a r. Member (Embed IO) r => InterpretersFor [Log a, AtomicState [a]] r Source #
Interpret Log
by prepending each message to a list in an AtomicState
, then interpret the AtomicState
in
a TVar
.
interpretCologAtomic' :: forall a r. Member (AtomicState [a]) r => InterpreterFor (Log a) r Source #
Interpret Log
by prepending each message to a list in an AtomicState
.