co-log-core: Composable Contravariant Comonadic Logging Library

[ comonad, contravariant, library, logging, mpl ] [ Propose Tags ]

This package provides core types and functions to work with the LogAction data type which is both simple and powerful.

newtype LogAction m msg = LogAction
    { unLogAction :: msg -> m ()
    }

The ideas behind this package are described in the following blog post:

See the following packages for different implementations based on co-log-core:

  • co-log: taggless final implementations.

  • co-log-polysemy: extensible effects implementation based on polysemy.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.0.0, 0.1.0, 0.1.1, 0.2.0.0, 0.2.1.0, 0.2.1.1, 0.3.0.0, 0.3.1.0, 0.3.2.0, 0.3.2.1
Change log CHANGELOG.md
Dependencies base (>=4.10 && <4.13) [details]
License MPL-2.0
Copyright 2018-2019 Kowainik
Author Dmitrii Kovanikov
Maintainer Kowainik <xrom.xkov@gmail.com>
Category Logging, Contravariant, Comonad
Home page https://github.com/kowainik/co-log
Bug tracker https://github.com/kowainik/co-log/issues
Source repo head: git clone https://github.com/kowainik/co-log.git
Uploaded by shersh at 2019-05-05T13:22:59Z
Distributions Arch:0.3.2.1, LTSHaskell:0.3.2.1, NixOS:0.3.2.1, Stackage:0.3.2.1
Reverse Dependencies 23 direct, 58 indirect [details]
Downloads 7899 total (183 in the last 30 days)
Rating 2.25 (votes: 2) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2019-05-05 [all 1 reports]

Readme for co-log-core-0.2.0.0

[back to package description]

co-log

MPL-2.0 license Build status

co-log-core Hackage Stackage LTS Stackage Nightly
co-log Hackage Stackage LTS Stackage Nightly
co-log-polysemy Hackage Stackage LTS Stackage Nightly

co-log is a composable and configurable logging framework. The idea of the approach is described in the following blog post:

The repository contains the following packages:

  • co-log-core: lightweight package with basic data types and general idea.
  • co-log: taggless final implementation of logging library based on co-log-core.
  • co-log-polysemy: implementation of logging library based on co-log-core and the polysemy extensible effects library.
  • co-log-benchmark: Benchmarks of the co-log library.

See the following tutorial series about the library:

Benchmarks

co-log is compared with basic functions like putStrLn. Since IO overhead is big enough, every benchmark dumps 10K messages to output. If benchmark name doesn't contain Message then this benchmark simply dumps string "message" to output, otherwise it works with Message data type from the co-log library.

Benchmarks Time for 10K messages
Prelude.putStrLn 5.117ms
Text.putStrLn 9.220ms
ByteString.putStrLn 2.971ms
mempty 1.181ms
logStringStdout 5.107ms
logPrint 5.248ms
logTextStdout 5.351ms
logByteStringStdout 2.933ms
logByteStringStderr 17.482ms
ByteString > (stdout <> stderr) 17.715ms
Message > format > stdout 9.188ms
Message > format > ByteString > stdout 3.524ms
Message{callstack} > format > stdout 9.139ms
Message{callstack:5} > format > stdout 9.464ms
Message{callstack:50} > format > stdout 9.439ms
Message{Time,ThreadId} > format > stdout 54.160ms
Message{Time,ThreadId} > format > ByteString > stdout 54.137ms