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

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

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, 1.0.1.0
Change log CHANGELOG.md
Dependencies aeson (>=2.0.0.0), base (<5), effectful-core (>=1.0.0.0 && <3.0.0.0), log-base (>=0.12.0.0), text, time [details]
Tested with ghc ==8.10.7 || ==9.0.2 || ==9.2.8 || ==9.4.8 || ==9.6.6 || ==9.8.2 || ==9.10.1
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 2024-11-07T17:54:16Z
Distributions NixOS:1.0.0.0
Downloads 508 total (53 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2024-11-07 [all 1 reports]

Readme for log-effectful-1.0.1.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"