monad-logger-prefix: Add prefixes to your monad-logger output

[ library, system ] [ Propose Tags ] [ Report a vulnerability ]

Add prefixes to your monad-logger output. See README for more info.


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0, 0.1.1, 0.1.2, 0.1.3, 0.1.4, 0.1.5, 0.1.6, 0.1.7, 0.1.8, 0.1.9, 0.1.10, 0.1.11, 0.1.12
Change log CHANGELOG.md
Dependencies base (>=4.7 && <5.0), exceptions (>=0.8.0 && <0.11.0), monad-control (>=1.0 && <1.1), monad-logger (>=0.3.12 && <0.4.0), mtl (>=2.1 && <2.3), resourcet (>=1.1 && <1.4), text (>=1.1 && <1.3), transformers (>=0.4.0 && <0.5.7), transformers-base (>=0.4 && <0.5), unliftio-core (>=0.1.1.0 && <0.3) [details]
License LicenseRef-Apache
Copyright 2016-2018 Seller Labs, 2018 Matthew Parsons
Author Matthew Parsons
Maintainer Matthew Parsons
Revised Revision 1 made by parsonsmatt at 2022-10-24T20:05:25Z
Category System
Home page https://github.com/parsonsmatt/monad-logger-prefix#readme
Bug tracker https://github.com/parsonsmatt/monad-logger-prefix/issues
Source repo head: git clone https://github.com/sellerlabs/monad-logger-prefix
Uploaded by parsonsmatt at 2020-12-08T15:52:11Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 7506 total (27 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2020-12-08 [all 1 reports]

Readme for monad-logger-prefix-0.1.12

[back to package description]

monad-logger-prefix

Build Status

This package provides an easy way to add prefixes to any MonadLogger. Here's a brief example:

{-# LANGUAGE TemplateHaskell #-}

import Control.Monad.Logger
import Control.Monad.Logger.Prefix

main :: IO ()
main = runStdoutLoggingT $ do
    $(logDebug) "This one has no prefix."

    "foo" `prefixLogs` do
        $(logDebug) "This one has a [foo] prefix."

        "bar" `prefixLogs` do
            $(logDebug) "This one has both [foo] and [bar] prefixes."

The package includes a benchmark demonstrating that there is no performance difference with ordinary logging.