co-log-polysemy 0.0.1.3 → 0.0.1.4
raw patch · 5 files changed
+77/−102 lines, 5 filesdep ~basenew-uploaderPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base
API changes (from Hackage documentation)
Files
- CHANGELOG.md +26/−6
- README.md +35/−89
- co-log-polysemy.cabal +14/−5
- src/Colog/Polysemy.hs +1/−1
- src/Colog/Polysemy/Effect.hs +1/−1
CHANGELOG.md view
@@ -3,30 +3,50 @@ `co-log-polysemy` uses [PVP Versioning][1]. The changelog is available [on GitHub][2]. +## 0.0.1.4 — Oct 20, 2023++## What's Changed+* update README.md by @udaycruise2903 in [#6](https://github.com/co-log/co-log-polysemy/pull/6)+* modified 'build-depends' section in README.md by @udaycruise2903 in [#7](https://github.com/co-log/co-log-polysemy/pull/7)+* GA(deps): Bump actions/checkout from 2 to 3 by @dependabot in [#9](https://github.com/co-log/co-log-polysemy/pull/9)+* GA(deps): Bump actions/cache from 2 to 3 by @dependabot in [#10](https://github.com/co-log/co-log-polysemy/pull/10)+* GA(deps): Bump haskell/actions from 1 to 2 by @dependabot in [#12](https://github.com/co-log/co-log-polysemy/pull/12)+* Support GHC 9.2. by @alaendle in [#14](https://github.com/co-log/co-log-polysemy/pull/14)+* GA(deps): Bump actions/checkout from 3 to 4 by @dependabot in [#19](https://github.com/co-log/co-log-polysemy/pull/19)+* GHC 9.6 by @alaendle in [#17](https://github.com/co-log/co-log-polysemy/pull/17)+* Support ghc-9.8 by @alaendle in [#20](https://github.com/co-log/co-log-polysemy/pull/20)+* Publish to hackage directly from GitHub by @alaendle in [#21](https://github.com/co-log/co-log-polysemy/pull/21)++## New Contributors+* @udaycruise2903 made their first contribution in [#6](https://github.com/co-log/co-log-polysemy/pull/6)+* @dependabot made their first contribution in [#9](https://github.com/co-log/co-log-polysemy/pull/9)+* @alaendle made their first contribution in [#14](https://github.com/co-log/co-log-polysemy/pull/14)++**Full Changelog**: https://github.com/co-log/co-log-polysemy/compare/v0.0.1.3...v0.0.1.4 ## 0.0.1.3 — Nov 2, 2021 -* [#223](https://github.com/kowainik/co-log/pulls/223):+* [#223](https://github.com/co-log/co-log/pulls/223): Support GHC-9.0.1. * Allow `polysemy-1.6.0.0`. * Bump up lower bound for `co-log-core` to `0.3.0.0`. ## 0.0.1.2 — Apr 18, 2020 -* [#186](https://github.com/kowainik/co-log/issues/186):+* [#186](https://github.com/co-log/co-log/issues/186): Support GHC-8.10.1. ## 0.0.1.1 — Feb 17, 2020 -* [#181](https://github.com/kowainik/co-log/issues/181):+* [#181](https://github.com/co-log/co-log/issues/181): Bump up `polysemy` to `1.3.0.0`. (by [@chshersh](https://github.com/chshersh)) ## 0.0.1.0 — Jan 19, 2020 -* [#121](https://github.com/kowainik/co-log/issues/121):+* [#121](https://github.com/co-log/co-log/issues/121): Add `LogAction` and interpreter that works directly with the `Sem` monad. (by [@chshersh](https://github.com/chshersh))-* [#148](https://github.com/kowainik/co-log/issues/148):+* [#148](https://github.com/co-log/co-log/issues/148): Support GHC-8.8.2. (by [@chshersh](https://github.com/chshersh)) * Bump up `polysemy` to the latest version.@@ -37,4 +57,4 @@ * Initially created. [1]: https://pvp.haskell.org-[2]: https://github.com/kowainik/co-log/releases+[2]: https://github.com/co-log/co-log/releases
README.md view
@@ -1,111 +1,57 @@-# co-log+# co-log-polysemy  -[](https://github.com/kowainik/co-log/actions)-[](https://travis-ci.org/kowainik/co-log)-[](https://ci.appveyor.com/project/kowainik/co-log)-[](https://github.com/kowainik/co-log/blob/main/LICENSE)+[](https://github.com/co-log/co-log-polysemy/actions)+[![Hackage][hk-img-ps]][hk-ps]+[](https://github.com/co-log/co-log/blob/main/LICENSE) +`co-log-polysemy` package is a implementation of the +[co-log-core](http://hackage.haskell.org/package/co-log-core) logging based on +the [polysemy](http://hackage.haskell.org/package/polysemy) extensible +effects library. -| | | | |-| :------------ | :--------------------------------- | :---------------------------------------- | :---------------------------------------------------- |-| `co-log-core` | [![Hackage][hk-img-core]][hk-core] | [![Stackage LTS][lts-img-core]][lts-core] | [![Stackage Nightly][nightly-img-core]][nightly-core] |-| `co-log` | [![Hackage][hk-img]][hk] | [![Stackage LTS][lts-img]][lts] | [![Stackage Nightly][nightly-img]][nightly] |-| `co-log-polysemy` | [![Hackage][hk-img-ps]][hk-ps] | [![Stackage LTS][lts-img-ps]][lts-ps] | [![Stackage Nightly][nightly-img-ps]][nightly-ps] | -`co-log` is a composable and configurable logging framework. It-combines all the benefits of Haskell idioms to provide a reasonable-and convenient interface. Though it uses some advanced concepts in its-core, we are striving to provide beginner-friendly API. The library-also contains complete documentation with a lot of beginner-friendly-examples, explanations and tutorials to guide users. The combination-of a pragmatic approach to logging and fundamental Haskell abstractions-allows us to create a highly composable and configurable logging-framework.+## How to use -If you're interested in how different Haskell typeclasses are used to-implement core functions of `co-log`, you can read the following blog-post which goes into detail about internal implementation specifics:+`co-log-polysemy` is compatible with the following GHC+versions - [supported versions](https://matrix.hackage.haskell.org/#/package/co-log-polysemy) -* [co-log: Composable Contravariant Combinatorial Comonadic Configurable Convenient Logging](https://kowainik.github.io/posts/2018-09-25-co-log)+In order to start using `co-log-polysemy` in your project, you+will need to set it up with these easy steps: -`co-log` is also modular on the level of packages. We care a lot about a-low dependency footprint so you can build your logging only on top of-the minimal required interface for your use-case. This repository contains-the following packages:+1. Add the dependency on `co-log-polysemy` in your project's+ `.cabal` file. For this, you should modify the `build-depends`+ section according to the below section: -* [`co-log-core`](co-log-core): lightweight package with basic data types and- general idea which depends only on `base`.-* [`co-log`](co-log): taggless final implementation of logging library based on- `co-log-core`.-* [`co-log-polysemy`](co-log-polysemy): implementation of logging library based- on `co-log-core` and the [`polysemy`](http://hackage.haskell.org/package/polysemy) extensible effects library.-* [`co-log-benchmark`](co-log-benchmark): benchmarks of the `co-log` library.+ ```haskell+ build-depends: base ^>= LATEST_SUPPORTED_BASE+ , co-log-core ^>= LATEST_VERSION+ , polysemy ^>= LATEST_VERSION+ ``` -To provide a more user-friendly introduction to the library, we've-created the tutorial series which introduces the main concepts behind `co-log`-smoothly:+2. To use this package, refer to the below example -* [Intro: Using `LogAction`](https://github.com/kowainik/co-log/blob/main/co-log/tutorials/1-intro/Intro.md)-* [Using custom monad that stores `LogAction` inside its environment](https://github.com/kowainik/co-log/blob/main/co-log/tutorials/2-custom/Custom.md)+ ```haskell+ module Main (main) where -`co-log` also cares about concurrent logging. For this purpose we have the `concurrent-playground`-executable where we experiment with different multithreading scenarios to test the library's behavior.-You can find it here:+ import Prelude hiding (log) -* [tutorials/Concurrent.hs](co-log/tutorials/Concurrent.hs)+ import Polysemy (Member, Sem, runM) -## Benchmarks+ import Colog.Core.IO (logStringStdout)+ import Colog.Polysemy (Log, log, runLogAction) -`co-log` is compared with basic functions like `putStrLn`. Since IO overhead is-big enough, every benchmark dumps 10K messages to output. If a benchmark's name-doesn't contain `Message` then this benchmark simply dumps the string `"message"`-to output, otherwise it works with the `Message` data type from the `co-log`-library. -To run benchmarks, use the following command:--```-cabal v2-run co-log-bench-```+ example :: Member (Log String) r => Sem r ()+ example = do+ log @String "First message..."+ log @String "Second message..." -| 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` |+ main :: IO ()+ main = runM $ runLogAction @IO logStringStdout example+ ``` -[hk-img]: https://img.shields.io/hackage/v/co-log.svg?logo=haskell [hk-img-ps]: https://img.shields.io/hackage/v/co-log-polysemy.svg?logo=haskell-[hk-img-core]: https://img.shields.io/hackage/v/co-log-core.svg?logo=haskell-[hk]: https://hackage.haskell.org/package/co-log [hk-ps]: https://hackage.haskell.org/package/co-log-polysemy-[hk-core]: https://hackage.haskell.org/package/co-log-core-[lts-img]: http://stackage.org/package/co-log/badge/lts-[lts-img-ps]: http://stackage.org/package/co-log-polysemy/badge/lts-[lts-img-core]: http://stackage.org/package/co-log-core/badge/lts-[lts]: http://stackage.org/lts/package/co-log-[lts-ps]: http://stackage.org/lts/package/co-log-polysemy-[lts-core]: http://stackage.org/lts/package/co-log-core-[nightly-img]: http://stackage.org/package/co-log/badge/nightly-[nightly-img-ps]: http://stackage.org/package/co-log-polysemy/badge/nightly-[nightly-img-core]: http://stackage.org/package/co-log-core/badge/nightly-[nightly]: http://stackage.org/nightly/package/co-log-[nightly-ps]: http://stackage.org/nightly/package/co-log-polysemy-[nightly-core]: http://stackage.org/nightly/package/co-log-core
co-log-polysemy.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.4 name: co-log-polysemy-version: 0.0.1.3+version: 0.0.1.4 synopsis: Composable Contravariant Comonadic Logging Library description: Implementation of the [co-log](http://hackage.haskell.org/package/co-log-core)@@ -21,7 +21,7 @@ license-file: LICENSE author: Dmitrii Kovanikov maintainer: Kowainik <xrom.xkov@gmail.com>-copyright: 2019-2020 Kowainik, 2021 Co-Log+copyright: 2019-2020 Kowainik, 2021-2023 Co-Log category: Logging, Contravariant, Comonad, Effects build-type: Simple stability: provisional@@ -31,14 +31,18 @@ GHC == 8.6.5 GHC == 8.8.4 GHC == 8.10.7- GHC == 9.0.1+ GHC == 9.0.2+ GHC == 9.2.8+ GHC == 9.4.7+ GHC == 9.6.3+ GHC == 9.8.1 source-repository head type: git location: https://github.com/co-log/co-log-polysemy.git common common-options- build-depends: base >= 4.11 && < 4.16+ build-depends: base >= 4.11 && < 4.20 ghc-options: -O2 -Wall@@ -56,6 +60,11 @@ ghc-options: -Wmissing-deriving-strategies if impl(ghc >= 8.10) ghc-options: -Wunused-packages+ if impl(ghc >= 9.0)+ ghc-options: -Winvalid-haddock+ if impl(ghc >= 9.2)+ ghc-options: -Wredundant-bang-patterns+ -Woperator-whitespace -- special options to make @polysemy@ fast if impl(ghc >= 8.6)@@ -87,7 +96,7 @@ Colog.Polysemy.Effect build-depends: co-log-core ^>= 0.3.0.0- , polysemy >= 1.2.0.0 && < 1.7+ , polysemy >= 1.2.0.0 && < 1.10 executable play-colog-poly import: common-options
src/Colog/Polysemy.hs view
@@ -1,7 +1,7 @@ {- | Module : Colog.Polysemy Copyright : (c) 2019-2020 Kowainik- (c) 2021 Co-Log+ (c) 2021-2023 Co-Log SPDX-License-Identifier : MPL-2.0 Maintainer : Co-Log <xrom.xkov@gmail.com> Stability : Provisional
src/Colog/Polysemy/Effect.hs view
@@ -3,7 +3,7 @@ {- | Module : Colog.Polysemy.Effect Copyright : (c) 2019-2020 Kowainik- (c) 2021 Co-Log+ (c) 2021-2023 Co-Log SPDX-License-Identifier : MPL-2.0 Maintainer : Co-Log <xrom.xkov@gmail.com> Stability : Provisional