monadlog

A simple and fast logging monad

Latest on Hackage:0.1.1.1@rev:1

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.

MIT licensed by winterland1989, zmactep
Maintained by pavel@yakovlev.me

This package is a fork of great `monad-log`, as the original author is unreachable.

It provides a mtl style MonadLog class and a concrete monad transformer LogT, the main difference between this package and monad-logger are:

  • Base monad has to be an instance of MonadIO.

  • Parametrized logging environment for extensibility.

  • Basic logging environment type(Label,Loc,NameSpace,ThreadId) are included, and you can easily make your own.

  • JSON logging built-in.

  • default to fast-logger backend, with good stdout and file support.

If you are an application author, you can use LogT transformer, it's just a specialized reader monad to inject `Logger env`.

If you are a library author, you should do following two things:

  • make your monad stack an instance of MonadLog, usually you can do this by embedding `Logger env` into your monad's reader part.

  • provide a default formatter, and API to run with customized formatter.