HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulelog-base-0.12.0.1Haskell2010

Log.Monad

The LogT monad transformer for adding logging capabilities to any monad.

  • 4 types
  • 4 values
datadata Logger
#

An object used for communication with a logger thread that outputs LogMessages using e.g. PostgreSQL, Elasticsearch or stdout (depending on the back-end chosen).

Instances2Semigroup, Monoid
newtypenewtype LogT (m :: Type -> Type) a
#

Monad transformer that adds logging capabilities to the underlying monad.

Constructors

Instances23MonadTrans, MonadTransControl, MFunctor, MonadError, MonadReader, MonadState, …
valuerunLogT
  1. :: Text

    Application component name to use.

  2. -> Logger

    The logging back-end to use.

  3. -> LogLevel

    The maximum log level allowed to be logged. Only messages less or equal than this level with be logged.

  4. -> LogT m a

    The LogT computation to run.

  5. -> m a
#

Run a LogT computation.

Note that in the case of asynchronous/bulk loggers runLogT doesn't guarantee that all messages are actually written to the log once it finishes. Use withPGLogger or withElasticSearchLogger for that.

valuegetLoggerIO :: MonadLog m => m (UTCTime -> LogLevel -> Text -> Value -> IO ())
#

Return an IO action that logs messages using the current MonadLog context. Useful for interfacing with libraries such as aws or amazonka that accept logging callbacks operating in IO.