The monad-logger-json package

[Tags:library, mit]

Convienence functions for logging ToJSON with monad-logger


[Skip to Readme]

Properties

Versions 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
Stability Unknown
Category Logging
Home page http://github.com/fpco/monad-logger-json
Source repository head: git clone https://github.com/fpco/monad-logger-json
Uploaded Tue Mar 31 22:54:15 UTC 2015 by dysinger
Distributions LTSHaskell:0.1.0.0, NixOS:0.1.0.0, Stackage:0.1.0.0, Tumbleweed:0.1.0.0
Downloads 285 total (6 in the last 30 days)
Votes
0 []
Status Docs available [build log]
Last success reported on 2015-05-20 [all 1 reports]

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Readme for monad-logger-json

Readme for monad-logger-json-0.1.0.0

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")