log package:co-log-polysemy

Log a message. If you semantic monad Sem has effect Log then you can send messages of type msg to that effect. This function can be used like this:
application :: Member (Log String) r => Sem r ()
application = do
log "Application started..."
log "Application finished..."
Effect responsible for logging messages of type msg. Has similar structure to LogAction. You can think of this effect in the following way in terms of the existing effects in polysemy:
  1. Like Output but specialised for logging.
  2. Like Trace but polymorphic over logged message.
LogAction that works directly with the Sem monad.
Composable Contravariant Comonadic Logging Library Implementation of the co-log logging based on the polysemy extensible effects library. The ideas behind this package are described in the following blog post: For the taggless final implementation of the co-log ideas se the following package:
Run a Log effect in terms of the given LogAction. The idea behind this function is the following: if you have LogAction m msg then you can use this action to tell how to io interpret effect Log. However, this is only possible if you also have Lift m effect because running log action requires access to monad m. This function allows to use extensible effects provided by the polysemy library with logging provided by co-log. You can construct LogAction independently and then just pass to this function to tell how to log messages. Several examples:
  1. runLogAction mempty: interprets the Log effect by ignoring all messages.
  2. runLogAction logStringStdout: interprets Log effect by allowing to log String to stdout.
Run Sem action with the corresponding LogActionSem. If you have plain LogAction that works with some monad m, use runLogAction instead.
Run Log as the Output effect. This function can be useful if you have an interpreter for the Output effect and you want to log messages using that interpreter.
Run Log as the Trace effect. This function can be useful if you have an interpreter for the Trace effect and you want to log strings using that interpreter.
Run Output as the Log effect. This function can be useful if you have an interpreter for the Log effect and you want to log messages using that interpreter.
Run Trace as the Log effect. This function can be useful if you have an interpreter for the Log effect and you want to log strings using that interpreter.