hw-polysemy-0.3.0.1: Opinionated polysemy library
Safe HaskellSafe-Inferred
LanguageHaskell2010

HaskellWorks.Polysemy.Log

Synopsis

Documentation

interpretDataLogLocalNoop :: forall a r. (a -> a) -> InterpreterFor (DataLog a) r Source #

interpretDataLogToJsonStdout :: forall e a r. Member (Embed IO) r => (e -> Value) -> Sem (DataLog e : r) a -> Sem r a Source #

logEntryToJson :: forall a. (a -> Value) -> LogEntry a -> Value Source #

annotateCs :: forall a r. Member GhcTime r => CallStack -> a -> Sem r (LogEntry a) Source #

Log a datalog message with the given severity and provided callstack.

logCs :: Members [Logger, GhcTime] r => CallStack -> Severity -> Text -> Sem r () Source #

Log a text message with the given severity and provided callstack.

setLogLevelFromEnv :: HasCallStack => Member (DataLog (LogEntry LogMessage)) r => Member (Embed IO) r => String -> Severity -> Sem r a -> Sem r a Source #

Set the log level for the duration of the computation to the severity provided in the environment variable of the given name or else the default severity for the duration of the computation.

Values for the log level are case-insensitive and can be one of the following:

  • trace
  • debug
  • info
  • warn
  • error
  • crit