monad-logger-json: JSON-friendly Logging APIs

[ library, logging, mit ] [ Propose Tags ] [ Report a vulnerability ]

Convienence functions for logging ToJSON with monad-logger


[Skip to Readme]

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0
Dependencies aeson, base (>=4.6 && <5), monad-logger, template-haskell, text [details]
License MIT
Author FP Complete Developers
Maintainer dev@fpcomplete.com
Category Logging
Home page http://github.com/fpco/monad-logger-json
Source repo head: git clone https://github.com/fpco/monad-logger-json
Uploaded by dysinger at 2015-03-31T22:54:15Z
Distributions LTSHaskell:0.1.0.0, NixOS:0.1.0.0, Stackage:0.1.0.0
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 1568 total (13 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2015-05-20 [all 1 reports]

Readme for monad-logger-json-0.1.0.0

[back to package description]

Monad Logger functions for JSON

TravisCI Hackage

Install

As a library:

cabal install monad-logger-json

Usage (example)

{-# LANGUAGE TemplateHaskell #-}

import Control.Monad.IO.Class ( MonadIO(liftIO) )
import Control.Monad.Logger ( runStdoutLoggingT )
import Control.Monad.Logger.JSON ( logInfoJ, logDebugJ )
import Data.Aeson.TH ( defaultOptions, deriveJSON )
import Data.Time.Clock ( UTCTime, getCurrentTime )

data Message = Message { time :: UTCTime }

$( deriveJSON defaultOptions ''Message )

main :: IO ()
main =
  runStdoutLoggingT
    (do now <- liftIO getCurrentTime
        $logDebugJ (Message now)
        $logInfoJ "Hello world")