loglevel: Log Level Datatype

[ library, mit, system ] [ Propose Tags ]

The package provides a LogLevel type for defining logging callbacks without depending on a particular logging framework.


[Skip to Readme]
Versions [faq] 0.1.0.0
Change log ChangeLog.md
Dependencies base (>=4.7 && <5.0), deepseq (>=1.4), text (>=1.0) [details]
License MIT
Copyright Copyright (C) 2018 Lars Kuhtz <lakuhtz@gmail.com>
Author Lars Kuhtz
Maintainer lakuhtz@gmail.com
Category System
Home page https://github.com/larskuhtz/loglevel
Bug tracker https://github.com/larskuhtz/loglevel/issues
Source repo head: git clone https://github.com/larskuhtz/loglevel
Uploaded by larsk at Thu Aug 30 06:10:05 UTC 2018
Distributions NixOS:0.1.0.0
Downloads 196 total (7 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2018-08-30 [all 1 reports]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for loglevel-0.1.0.0

[back to package description]

Build Status

Log Level Datatype

This package provides a Haskell log-level datatype. It allows to specify APIs with logging-callbacks without depending on a particular logging framework.

There is a large number of different Haskell logging frameworks that support different use cases and backends. As a consequence these framework make different trade-offs with respect to their architecture and implementation. Often they have complex internals and many external dependencies.

While logging frameworks differ a lot in their internals and backends, they tend to have similar frontends. In particular, many software components depend for logging only on a callback function that typically has a type similar to

loggingCallback ∷ LogLevel → Text → IO ()

The only framework-specific dependency is the LogLevel type. This type is in most cases similar, often isomorphic, and sometimes even identical across different frameworks.

It is unfortunate that a software component has to depend on a particular logging framework (and all of the frameworks dependencies) just for using the LogLevel type that is almost identical throughout most logging frameworks.

This package allows software components to include logging callbacks in their APIs without depending on a particular logging framework.


Even more complex logging callbacks often have a type along the lines of

genericLoggingCallback ∷ c a ⇒ LogLevel → a → IO ()

where c is a constraint made up from common type classes like ToJSON, Serializable, NFData, or Generic.