co-log-polysemy-formatting- A Polysemy logging effect for high quality (unstructured) logs.
Safe HaskellNone





data ThreadTimeMessage Source #

A log message which wraps a Message, adding a ThreadId and UTCTime timestamp.

ttmSeverity :: ThreadTimeMessage -> Severity Source #

Get the severity of the message.

addThreadAndTimeToLog :: Members '[Embed IO, Log ThreadTimeMessage] r => Sem (Log Message ': r) a -> Sem r a Source #

Add the thread id and a timestamp to messages in the log. This should be called before any use of asyncToIO, otherwise all log messages will have the same thread id. It is best called after any use of filterLogs, otherwise you're needlessly processing messages that will never be logged (TODO: test this assertion is true).