extensible-effects-concurrent-0.29.2: Message passing concurrency as extensible-effect

Safe HaskellNone
LanguageHaskell2010

Control.Eff.LogWriter.DebugTrace

Description

This helps to setup logging via Debug.Trace.

Synopsis

Documentation

withTraceLogWriter :: forall h e a. (Monad (LogWriterM h), LogsTo h e) => Eff e a -> Eff e a Source #

Enable logging via traceM using the debugTraceLogWriter. The logging monad type can be any type with a Monad instance.

Log messages are rendered using renderLogMessageConsoleLog.

Example:

exampleWithTraceLogWriter :: IO ()
exampleWithTraceLogWriter =
    runLift
  $ withSomeLogging @IO
  $ withTraceLogWriter
  $ logInfo "Oh, hi there"

withTraceLogging Source #

Arguments

:: Lifted IO e 
=> Text

The default application name to put into the lmAppName field.

-> Facility

The default RFC-5424 facility to put into the lmFacility field.

-> LogPredicate

The inital predicate for log messages, there are some pre-defined in Control.Eff.Log.Message

-> Eff (Logs ': (LogWriterReader (Lift IO) ': e)) a 
-> Eff e a 

Enable logging via traceM using the debugTraceLogWriter, with some LogMessage fields preset as in withIoLogging.

Log messages are rendered using renderLogMessageConsoleLog.

Example:

exampleWithTraceLogging :: IO ()
exampleWithTraceLogging =
    runLift
  $ withTraceLogging "my-app" local7 allLogMessages
  $ logInfo "Oh, hi there"