log-effectful: Adaptation of the log library for the effectful ecosystem.

[ bsd3, library, system ] [ Propose Tags ]

Adaptation of the log-base library for the effectful ecosystem.


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 1.0.0.0
Change log CHANGELOG.md
Dependencies base (<5), effectful-core (>=1.0.0.0 && <3.0.0.0), log-base (>=0.12.0.0), text, time [details]
License BSD-3-Clause
Author Andrzej Rybczak, Dominik Peteler
Maintainer andrzej@rybczak.net
Category System
Bug tracker https://github.com/haskell-effectful/log-effectful/issues
Source repo head: git clone https://github.com/haskell-effectful/log-effectful
Uploaded by arybczak at 2022-10-10T11:30:36Z
Distributions NixOS:1.0.0.0
Downloads 333 total (16 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2022-10-10 [all 1 reports]

Readme for log-effectful-1.0.0.0

[back to package description]

log-effectful

Build Status Hackage Dependencies Stackage LTS Stackage Nightly

Adaptation of the log-base library for the effectful ecosystem.

Example

A sample usage for logging to both standard output and Elasticsearch:

{-# LANGUAGE OverloadedStrings #-}
module Main where

import Effectful
import Effectful.Log
import Log.Backend.ElasticSearch
import Log.Backend.StandardOutput

main :: IO ()
main = runEff $ do
  let config = defaultElasticSearchConfig
        { esServer = "http://localhost:9200"
        , esIndex  = "logs"
        }
  withStdOutLogger $ \stdoutLogger -> do
    withElasticSearchLogger config $ \esLogger -> do
      runLog "main" (stdoutLogger <> esLogger) defaultLogLevel $ do
        logInfo_ "Hi there"